日期:2014-05-18 浏览次数:20447 次
EXEC master..xp_cmdshell 'bcp test.dbo.book1 in D:\test\2010-3-2.txt -t"\t" -c -S"127.0.0.1" -U"sa" -P"30687724"'
NULL 开始复制... SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 SQLState = 22005, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]对于造型说明无效的字符值 NULL BCP 复制 in 失败 NULL
-- 建导入的文件D:\0110.txt 内容: 日期 时间 CGI BSC TCH话务量 2010-3-3 0 460-00-32808-39011 BSC07 4.240695953 2010-3-3 0 460-00-32808-39012 BSC07 2.32038331 -- 建测试表 create table book1 (a date,b int,c varchar(20), d varchar(10), e decimal(10,7)) -- bulk insert导入 bulk insert DBAP.dbo.book1 from 'D:\0110.txt' with ( FIELDTERMINATOR =' ', -- 分隔符 ROWTERMINATOR ='\n', KILOBYTES_PER_BATCH=5000, firstrow=2 ) select * from book1 a b c d e ---------- ----------- -------------------- ---------- --------------------------------------- 2010-03-03 0 460-00-32808-39011 BSC07 4.2406960 2010-03-03 0 460-00-32808-39012 BSC07 2.3203833 (2 row(s) affected)