I've been trying to export the contents of an XML variable to a file on my disk from SSMS (SQL Server Management Studio) with the following command.
我一直在尝试使用以下命令从SSMS(SQL Server Management Studio)将XML变量的内容导出到我的磁盘上的文件中。
EXEC xp_cmdshell 'bcp "SELECT @xml_file" queryout "C:\Radu\bcptest.txt" -T -c -t'
When running this command I'm constantly getting this error:
运行此命令时,我不断收到此错误:
I've searched for answers and most of the things I found involved adding this NT AUTHORITY\NETWORK SERVICE
user to my database as a trusted user in SSMS, which would log in using Windows authentication, but this still didn't work.
我已经搜索了答案,我发现的大多数事情都涉及将这个NT AUTHORITY \ NETWORK SERVICE用户作为SSMS中的可信用户添加到我的数据库中,这将使用Windows身份验证登录,但这仍然无效。
I have also added roles as bulkadmin
and public
(in case of the user in Security->Logins path), db_datareader
, db_datawriter
and public
, access to the master
database which I am using (permission to connect, login), and also the same properties and permissions for the DB_BULK_IMPORT_User
, but without success.
我还添加了bulkadmin和public(在用户处于Security-> Logins路径的情况下),db_datareader,db_datawriter和public,访问我正在使用的master数据库(连接,登录权限)以及相同的角色DB_BULK_IMPORT_User的属性和权限,但没有成功。
I've also changed in IIS the Impersonation
of ASP .NET to enabled and restarted IIS server and the database server after each modification.
我还在IIS中将ASP .NET的模拟改为在每次修改后启用并重新启动IIS服务器和数据库服务器。
Is there something I'm missing? Or something I'm doing too much?
有什么我想念的吗?或者我做得太多了?
Thanks in advance!
提前致谢!
1 个解决方案
#1
1
-T
flag specifies that you are using a trusted connection using integrated security. You may want to drop the -T
and try specifying a username (-U
) and password (-P
).
-T标志指定您使用集成安全性的可信连接。您可能希望删除-T并尝试指定用户名(-U)和密码(-P)。
#1
1
-T
flag specifies that you are using a trusted connection using integrated security. You may want to drop the -T
and try specifying a username (-U
) and password (-P
).
-T标志指定您使用集成安全性的可信连接。您可能希望删除-T并尝试指定用户名(-U)和密码(-P)。