批量插入语法 SQL
我无法通过 C# 在我的 Web 服务器或本地运行 SQL 批量插入语句。 我正在尝试将数据从文本文件导入到 SQL Web Server。
连接到 Web 服务器/SQL Server 后 我使用的语句如下..
BULK INSERT dbo.FNSR
FROM 'http:\\yahoodd.velocitytrading.net\txtfiles\FNSR.txt'
WITH
(
FIRSTROW = '2',
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
然后我收到此错误。
无法批量加载,因为无法打开文件“\yahoodd.velocitytrading.net\txtfiles\FNSR.txt”。操作系统错误代码53(未找到网络路径。)。
我也用上面列出的“http”://webserver.remotefile.txt'尝试过......结果略有不同(错误代码123目录,路径无效)
有什么想法吗?我无法上传txt文件作为本地 txt 文件发送到 Web 服务器...我做错了什么...这应该如何工作?
I can not get a SQL Bulk Insert Statement to Run via C# on my Web Server or locally.
I am trying to import data from a text file into a SQL Web Server.
After I connect to the Web server / SQL Server the
The statement I am using is as as follows..
BULK INSERT dbo.FNSR
FROM 'http:\\yahoodd.velocitytrading.net\txtfiles\FNSR.txt'
WITH
(
FIRSTROW = '2',
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
then I get this error.
Cannot bulk load because the file "\yahoodd.velocitytrading.net\txtfiles\FNSR.txt" could not be opened. Operating system error code 53(The network path was not found.).
I have tried this with 'http"://webserver.remotefile.txt' as listed above also... with a slightly different result (error code 123 dir, path not valid )
Any ideas?? I can not upload the txt file to the WebServer as a local txt file... what I am I doing wrong.. how is this supposed to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要指定共享数据文件,请使用其通用命名约定 (UNC) 名称,其一般形式为 \Servername\Sharename\Path\Filename。此外,用于访问数据文件的帐户必须具有读取远程磁盘上的文件所需的权限。
http://msdn.microsoft.com/en-us/library/ms175915.aspx
To specify a shared data file, use its universal naming convention (UNC) name, which takes the general form, \Servername\Sharename\Path\Filename. Additionally, the account used to access the data file must have the permissions that are required for reading the file on the remote disk.
http://msdn.microsoft.com/en-us/library/ms175915.aspx
它有两个斜杠并且没有 http
Its two slashes and no http
它必须是本地驱动器。
FROM 'http:\yahoodd.velocitytrading.net\txtfiles\FNSR.txt' 部分应替换为 C:.......\some.txt 。
如果它来自http://...,您将必须通过它进行流式传输。
It has to be a local drive.
The part FROM 'http:\yahoodd.velocitytrading.net\txtfiles\FNSR.txt' should be replaced by C:.......\some.txt.
If it's from http://... you will have to stream through it.