sql server Bulk 批量导入大量数据

时间:2022-03-18 06:37:27
INSERT INTO RV_DetailedData (Email,Url)
SELECT * FROM OPENROWSET
(BULK 'E:\ftp\Travis\成功or点击\点击人数.csv','') AS t1

INSERT INTO RV_DetailedData (Email,Url)
SELECT * FROM OPENROWSET
(BULK 'E:\ftp\Travis\成功or点击\点击人数.csv',FORMATFILE='E:\ftp\Travis\成功or点击\da.xml') AS t1

INSERT INTO RV_DetailedData (Email)
SELECT * FROM OPENROWSET
(BULK 'E:\ftp\Travis\成功or点击\成功.csv',FORMATFILE='E:\ftp\Travis\成功or点击\复件 da.xml') AS t1



<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="255" COLLATION="Chinese_PRC_CI_AS" />
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\n" MAX_LENGTH="255" COLLATION="Chinese_PRC_CI_AS" />
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="Email" xsi:type="SQLNVARCHAR" />
<COLUMN SOURCE="2" NAME="Url" xsi:type="SQLNVARCHAR" />
</ROW>
</BCPFORMAT>

<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\n" MAX_LENGTH="255" COLLATION="Chinese_PRC_CI_AS" />

</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="Email" xsi:type="SQLNVARCHAR" />

</ROW>
</BCPFORMAT>