Skip to main content
黑话筒

In BCP command, database name and table name must begin with letter or underscore, and can’t contains hyphen.

One of our database name is "0726", and another database is "demo07-26".

We use the following command to import data:

bcp 0726..abc in f:\io.txt -S. -Usa -Pmypass -c -F1

bcp demo07-26..abc in f:\io.txt -S. -Usa -Pmypass -c -F1

Both command will shows an error message:

An error occurred while processing the command line.

Database name or table name begin with number is not a good habit, if you insist to do this, you may use [] to surround your database name.

bcp [0726..abc] in f:\io.txt -S. -Usa -Pmypass -c -F1

bcp [demo07-26..abc] in f:\io.txt -S. -Usa -Pmypass -c -F1

That will works.