简体   繁体   English

批量插入SQL Server

[英]bulk insert sql server

When using the T-SQL Bulk insert command from SQL Server Management Stuidio, I am getting this error randomly. 从SQL Server Management Stuidio使用T-SQL批量插入命令时,我随机收到此错误。 Not everytime. 并非每次都这样。 Sometimes it would work completely fine and sometimes it throws me the below error. 有时它会完全正常工作,有时会抛出以下错误。

Error: Cannot bulk load because the file "\\xxxxx\\xxxxxx\\xxxxxx\\xxxxxxx\\xxxxxxx.xsd" could not be opened. 错误:由于无法打开文件“ \\ xxxxx \\ xxxxxx \\ xxxxxx \\ xxxxxxx \\ xxxxxxx.xsd”,因此无法批量加载。 Operating system error code 1326(Logon failure: unknown user name or bad password.). 操作系统错误代码1326(登录失败:用户名未知或密码错误。)。

I can access the share drive from my machine and in fact, I was the one who kept that file in that particular share drive. 我可以从我的机器访问共享驱动器,实际上,我是将该文件保存在该特定共享驱动器中的人。

Use UNC paths: 使用UNC路径:

\\yourcomputername\sharename\filename.xsd

Bulk inserts use delegation, so make sure your share can be accessed by the user that performs the BULK INSERT command in SQL Server. 批量插入使用委托,因此请确保SQL Server中执行BULK INSERT命令的用户可以访问您的共享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM