I'm having trouble using the SQL BCP process to load up my tables with data. I'm calling it from a .NET application, so I execute the xp_cmdshell executable to run the bcp command. Here is what one of these commands looks like:
EXEC master..xp_cmdshell 'bcp "[D001Test.Restore].[dbo].[GeneralComments]" in "<DataFile>" -q -c -t "|_|" -r "|+~+|" -k -V80 -a33000 -E -STest'
When the database name I am importing into (in this case D001Test.Restore) has a "." in the name, the bcp command fails. Is there any way around this? I have tried both with and without the brackets. I may have to import the data into a new database, and rename it to the desired name after it is done.