日期:2014-05-18 浏览次数:20566 次
CREATE TABLE [dbo].[IP2ProxyIPCountry] ( [A] [nvarchar] (15) NOT NULL , [B] [char] (2) NOT NULL , [C] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY]
<?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="15"/> <FIELD ID="2" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="2"/> <FIELD ID="3" xsi:type="CharTerm" TERMINATOR="\n" MAX_LENGTH="64"/> </RECORD> <ROW> <COLUMN SOURCE="1" NAME="A" xsi:type="nvarchar"/> <COLUMN SOURCE="2" NAME="B" xsi:type="char"/> <COLUMN SOURCE="3" NAME="C" xsi:type="nvarchar"/> </ROW> </BCPFORMAT>
BULK INSERT 表 FROM 'c:\1.csv' with (FORMATFILE='c:\1.xml');
BULK INSERT 库名..表名 FROM 'c:\1.txt' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )