mssql server 存储过程里,bulk insert table from '路径+文件',路径固定,文件名不固定的实现方法
程序员文章站
2022-06-11 18:18:10
动态语句, bulk insert的from 子句只能使用常量.&nb...
动态语句, bulk insert的from 子句只能使用常量.
CREATE proc test
@fn varchar(50)
as
declare @path varchar(100)
set @path= 'd:\'
exec('
bulk INSERT table FROM '''+@path+@fn+'''
WITH
(
FIELDTERMINATOR = '','',
ROWTERMINATOR = ''\n''
)')
摘自CSDN
CREATE proc test
@fn varchar(50)
as
declare @path varchar(100)
set @path= 'd:\'
exec('
bulk INSERT table FROM '''+@path+@fn+'''
WITH
(
FIELDTERMINATOR = '','',
ROWTERMINATOR = ''\n''
)')
摘自CSDN
下一篇: oracle通过行范围查询取4至10行