且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用户 NT 权限/匿名登录的 BCP 导出登录失败

更新时间:2023-12-03 18:33:58

您正在将命令传递给外部应用程序.

You're passing off a command to an external application.

此外部应用程序并不真正了解您,也不了解您的命令来自何处.因此,ANONYMOUS LOGON 消息.

This external application doesn't really know you, or where your command came from. Hence the ANONYMOUS LOGON message.

您需要告诉命令以谁的身份执行.看看 BoL 中的 BCP (http://msdn.microsoft.com/en-us/library/ms162802.aspx),您会发现一些您可能希望添加的参数:

You need to tell the command who to execute as. Have a look at BCP in BoL (http://msdn.microsoft.com/en-us/library/ms162802.aspx) and you'll spot a few parameters that you might wish to add:

-T指定 bcp 实用程序使用集成安全性通过可信连接连接到 SQL Server.不需要网络用户的安全凭证、login_id 和密码.如果不指定-T,则需要指定-U和-P才能成功登录.

-U login_id指定用于连接到 SQL Server 的登录 ID.

-P 密码指定登录 ID 的密码.如果未使用此选项,bcp 命令会提示输入密码.如果在没有密码的命令提示符末尾使用此选项,bcp 将使用默认密码 (NULL).