gpt4 book ai didi

sql-server - SQL Server 批量插入 Http 文件

转载 作者:行者123 更新时间:2023-12-03 09:32:33 24 4
gpt4 key购买 nike

我正在尝试批量插入位于远程 Web 服务器上的 csv 文件,但出现以下错误。

Cannot bulk load because the file "http://34.34.32.34/test.csv" could not be opened. Operating system error code 123(The filename, directory name, or volume label syntax is incorrect.).

有没有办法做到这一点?

最佳答案

BULK INSERT 的文档没有说明 SQL Server 能够连接到 Web 服务器。

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

' data_file ' Is the full path of the data file that contains data to import into the specified table or view. BULK INSERT can import data from a disk (including network, floppy disk, hard disk, and so on).

data_file must specify a valid path from the server on which SQL Server is running. If data_file is a remote file, specify the Universal Naming Convention (UNC) name. A UNC name has the form \Systemname\ShareName\Path\FileName. For example, \SystemX\DiskZ\Sales\update.txt.

如果您必须从 HTTP 导入文件,请考虑编写 CLR 存储过程或使用 SSIS 的外部连接功能。

关于sql-server - SQL Server 批量插入 Http 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7779530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com