批量插入语法 SQL

发布于 2024-10-06 19:10:35 字数 676 浏览 7 评论 0原文

我无法通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岁月苍老的讽刺 2024-10-13 19:10:35

要指定共享数据文件,请使用其通用命名约定 (UNC) 名称,其一般形式为 \Servername\Sharename\Path\Filename。此外,用于访问数据文件的帐户必须具有读取远程磁盘上的文件所需的权限。

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

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.

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

http://msdn.microsoft.com/en-us/library/ms175915.aspx

未蓝澄海的烟 2024-10-13 19:10:35

它有两个斜杠并且没有 http

BULK INSERT dbo.FNSR FROM '\\yahoodd.velocitytrading.net\txtfiles\FNSR.txt' 
WITH ( FIRSTROW = '2', FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n' )

Its two slashes and no http

BULK INSERT dbo.FNSR FROM '\\yahoodd.velocitytrading.net\txtfiles\FNSR.txt' 
WITH ( FIRSTROW = '2', FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n' )
季末如歌 2024-10-13 19:10:35

它必须是本地驱动器。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文