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

时间:2017-03-04 17:00:49

标签: sql sql-server bcp

MSDN表示,如果表名为AdventureWorks2012,则在dbo模式下的bcp AdventureWorks2012..MyTestFormatFiles format nul -c -t, -f myTestFormatFiles.Fmt -T 示例数据库中创建表,因此命令为:

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

我的情况:

enter image description here

我试过这个:

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,例如{{1}}。

我的问题到底是什么?

1 个答案:

答案 0 :(得分:1)

通过在命令中添加amp-html-layout来添加服务器\实例名称。