Home > Database > Mysql Tutorial > mssql server 存储过程里,bulk insert table from ''路径+文

mssql server 存储过程里,bulk insert table from ''路径+文

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:57:30
Original
1133 people have browsed it

mssql server 存储过程里,bulk insert table from ''路径+文件'',路径固定,文件名不固定的实现方法

动态语句, 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
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template