批量插入语法SQL [英] BULK INSERT Syntax SQL

查看:93
本文介绍了批量插入语法SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Web服务器上或本地通过C#运行SQL大容量插入语句。
我试图将数据从文本文件导入SQL Web Server。

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.

连接到Web服务器/ SQL 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'
)

然后我得到此错误。 / p>

then I get this error.


由于无法打开文件 \yahoodd.velocitytrading.net\txtfiles\FNSR.txt,因此无法批量加载。操作系统错误代码53(找不到网络路径。)。

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.).

我已经尝试过使用'http:// webserver上面列出的.remotefile.txt'也...结果略有不同(错误代码123 dir,路径无效)

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 )

任何想法吗?我无法上传将txt文件作为本地txt文件发送到WebServer ...我做错了..这应该如何工作?

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?

推荐答案

要指定共享数据文件,请使用其通用命名约定(UNC)名称,其通用格式为服务器名 \共享名 \路径 \文件名。另外,用于访问数据文件的帐户必须具有读取远程磁盘上的文件所需的权限。

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.

BULK INSERT AdventureWorks2008R2.Sales.SalesOrderDetail
   FROM '\\computer2\salesforce\dailyorders\neworders.txt';
GO

http://msdn.microsoft.com/zh-cn/library/ms175915.aspx

这篇关于批量插入语法SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆