BCP 实用程序。创建格式文件

BCP Utility. Creating format-file

MSDN 说如果 table 名称是 myTestFormatFiles,table 是在 dbo 模式下的 AdventureWorks2012 示例数据库中创建的,所以命令是:

bcp AdventureWorks2012..MyTestFormatFiles format nul -c -t, -f myTestFormatFiles.Fmt -T

我的情况:

我试过这个:

bcp TestDB..test_table format nul -c -t, -f d:\format.fmt -T

结果如下:

SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could no
t open a connection to SQL Server [2].
SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]A network-related or instance-
specific error has occurred while establishing a connection to SQL Server. Serve
r is not found or not accessible. Check if instance name is correct and if SQL S
erver is configured to allow remote connections. For more information see SQL Se
rver Books Online.
SQLState = S1T00, NativeError = 0
Error = [Microsoft][SQL Server Native Client 11.0]Login timeout expired

我认为 TestDB..test_table 有问题。可能我需要在命令中指定 k551l\sqlexpress,比如 k551l\sqlexpress..TestDB..test_table.

我的问题到底是什么?

通过在命令中添加 -S k551l\sqlexpress 来添加 server\instance 名称。