来自 FTP 的批量插入 SQL 服务器:文件路径问题
BULK INSERT SQL SERVER from FTP: Filepath Issue
这里是偶然的 DBA:
我尝试从 SQL Server 2014 获取我的 UNIX ERP 系统的各种 CSV 导出文件,而不是传输到我的本地驱动器并从那里上传。我必须从 ERP 系统执行导出,然后将它们发送到 FTP。当我使用批量插入命令时出现此错误:
Operating system error code 3(The system cannot find the path specified.)
参考代码:
BULK
INSERT [SALES].DBO.[CUSTOMER-MASTER]
FROM '/tmp/export/customer.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
我不知道正确的文件路径是什么,也不知道在哪里可以找到它。我该如何解决?
该路径必须是 SQL 服务器光盘中的文件,或者是 windows 共享 (SMB) 服务器是 运行 的帐户可以使用 UNC 路径访问的文件.来自 documentation:
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.
这里是偶然的 DBA:
我尝试从 SQL Server 2014 获取我的 UNIX ERP 系统的各种 CSV 导出文件,而不是传输到我的本地驱动器并从那里上传。我必须从 ERP 系统执行导出,然后将它们发送到 FTP。当我使用批量插入命令时出现此错误:
Operating system error code 3(The system cannot find the path specified.)
参考代码:
BULK
INSERT [SALES].DBO.[CUSTOMER-MASTER]
FROM '/tmp/export/customer.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
我不知道正确的文件路径是什么,也不知道在哪里可以找到它。我该如何解决?
该路径必须是 SQL 服务器光盘中的文件,或者是 windows 共享 (SMB) 服务器是 运行 的帐户可以使用 UNC 路径访问的文件.来自 documentation:
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.