Question

Trying to do something very simple here with SQL Server 2012... I'm trying to follow the steps found here: http://www.advancesharp.com/blog/1083/bulk-insert-with-text-qualifier-in-sql-server

I'm using the Windows Authentication method.

bcp dbname.schema.Products format -c -t -f d:\test.fmt -T

What exactly do I put as dbname.schema.Products?

My database is called [Manipulate MC BS], the table is called [MASTER]

do I write the following?:

bcp [Manipulate MC BS].dbo.[MASTER] format -c -t -f d:\test.fmt -T

Any help would be great!

Cheers, Lucas

No correct solution

OTHER TIPS

Try using quotation marks or specifying the -q parameter as suggested before (or just do both, it won't hurt).

bcp "[Manipulate MC BS].dbo.[MASTER]" format -c -t -f d:\test.fmt -T

MSDN bcp Utility

Specifying Identifiers That Contain Spaces or Quotation Marks

SQL Server identifiers can include characters such as embedded spaces and quotation marks. Such identifiers must be treated as follows:

  • When you specify an identifier or file name that includes a space or quotation mark at the command prompt, enclose the identifier in quotation marks ("").

For example, the following bcp out command creates a data file named Currency Types.dat:

 bcp AdventureWorks2012.Sales.Currency out "Currency Types.dat" -T -c

To specify a database name that contains a space or quotation mark, you must use the -q option.

  • For owner, table, or view names that contain embedded spaces or quotation marks, you can either:

  • Specify the -q option, or

  • Enclose the owner, table, or view name in brackets ([]) inside the quotation marks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top