Skip to content

Table Delimiters Required #21

Description

@wwetzel

Love this library big time.

I installed bcp utils on a new machine recently and was having issues getting it to run. Further investigation revealed this error was being thrown with the raw command in a command prompt.

"A valid table name is required for in, out, or format options."

This did NOT work:
bcp database-123.dbo.table IN "C:\\Users\\my_user\\Desktop\\data\\my_csv.csv" -f C:\\Users\\my_user\\AppData\\Local\\Temp\\t9Lvdf2f32s7nw4I -S sql_server_address -b 10000 -U username -P password -F 2

This did work:
bcp [database-123].[dbo].[table] IN "C:\\Users\\my_user\\Desktop\\data\\my_csv.csv" -f C:\\Users\\my_user\\AppData\\Local\\Temp\\t9Lvdf2f32s7nw4I -S sql_server_address -b 10000 -U username -P password -F 2

This was fixed by adding brackets to binary_callers.py for the full_table_string. I believe this was due to the database having hyphens in the name - I don't see any harm in making this change, as it doesn't impact non special character identifiers.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions