我想把一个文本文档导入到数据库中,以下是文本文档的格式:
08/07/08 16:23:29 GeneralMoney: chen, 4, 122, 2, 192.168.2.22, 192.168.1.82, 交换, 项目ID=64587,金额=50
08/07/08 16:23:31 GeneralMoney: han, 4, 122, 2000, 192.168.2.27, 192.168.1.82, 交换, 项目ID=47852,金额=20000想导入到数据库中后为12列,分别为:A B C D E F G H I J K L
08/07/08 16:23:29 GeneralMoney chen 4 122 2 192.168.2.22 192.168.1.82 交换 项目ID=64587 金额=50
08/07/08 16:23:31 GeneralMoney han 4 122 2000 192.168.2.27 192.168.1.82 交换 项目ID=47852 金额=20000请问应该怎么操作?
08/07/08 16:23:29 GeneralMoney: chen, 4, 122, 2, 192.168.2.22, 192.168.1.82, 交换, 项目ID=64587,金额=50
08/07/08 16:23:31 GeneralMoney: han, 4, 122, 2000, 192.168.2.27, 192.168.1.82, 交换, 项目ID=47852,金额=20000想导入到数据库中后为12列,分别为:A B C D E F G H I J K L
08/07/08 16:23:29 GeneralMoney chen 4 122 2 192.168.2.22 192.168.1.82 交换 项目ID=64587 金额=50
08/07/08 16:23:31 GeneralMoney han 4 122 2000 192.168.2.27 192.168.1.82 交换 项目ID=47852 金额=20000请问应该怎么操作?
解决方案 »
- 领教了SQL的查找速度。不知道哪位大侠还能让SQL更快。高分求问
- 求sql 存储过程
- ado连接SQL第2实例
- 关于IMAGE类型字段只,存放PDF文件后,对其进行全文检索问题。邹建和大力在吗?在线等,谢谢!!!注意是PDF文件
- server sql2008无法用:任务->导入数据
- 有关XPLOG70.DLL,强分送强人!
- 存储过程循环表的一列数据
- 将存储过程执行结果赋值给变量
- 对datetime数据类型的模糊查询怎么就是不行???
- 如何让数据在SQL里面按一定规则排序?
- sql server 2005 express 下生成的mdf文件如何附加到sql server2000
- 求助,达人们给个建议
insert into table(字段) select 字段1的一部分,字段1的第二部分,字段1的第三部分,字段1的第四部分,其它字段
select left(字段1,charindex(' ',字段1)......
create table [tablename] (
A varchar(64),
B varchar(64),
C varchar(64),
D varchar(64),
E varchar(64),
F varchar(64),
G varchar(64),
H varchar(64),
I varchar(64),
J varchar(64),
K varchar(64),
L varchar(64)
)
go
BULK INSERT [tablename]
FROM 'filename'
WITH
(
FIRSTROW = 1,
FIELDTERMINATOR = '\t', -- or ' '
ROWTERMINATOR = '\n'
)
go
Messages
Warning 0x80047076: Data Flow Task: The output column " 0天->80天" (10) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
Warning 0x80047076: Data Flow Task: The output column " 300" (14) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
Warning 0x80047076: Data Flow Task: The output column " 219 149 11 15" (18) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
Warning 0x80047076: Data Flow Task: The output column " 0天->80天" (10) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
Warning 0x80047076: Data Flow Task: The output column " 300" (14) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
Warning 0x80047076: Data Flow Task: The output column " 219 149 11 15" (18) on output "Flat File Source Output" (2) and component "Source - Money0808_txt" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
(SQL Server Import and Export Wizard)
- Prepare for Execute (Success)- Pre-execute (Success)
Messages
Information 0x402090dc: Data Flow Task: The processing of file "D:\Money0808.txt" has started.
(SQL Server Import and Export Wizard)
- Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column " 0天->80天" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)
Error 0xc020902a: Data Flow Task: The "output column " 0天->80天" (10)" failed because truncation occurred, and the truncation row disposition on "output column " 0天->80天" (10)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)
Error 0xc0202092: Data Flow Task: An error occurred while processing file "D:\Money0808.txt" on data row 3.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Money0808_txt" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited.
(SQL Server Import and Export Wizard)
Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled.
(SQL Server Import and Export Wizard)
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.
(SQL Server Import and Export Wizard)
- Copying to [test].[dbo].[Money0808] (Stopped)- Post-execute (Success)
Messages
Information 0x402090dd: Data Flow Task: The processing of file "D:\Money0808.txt" has ended.
(SQL Server Import and Export Wizard)
Information 0x402090df: Data Flow Task: The final commit for the data insertion has started.
(SQL Server Import and Export Wizard)
Information 0x402090e0: Data Flow Task: The final commit for the data insertion has ended.
(SQL Server Import and Export Wizard)
- Cleanup (Success)
Messages
Information 0x4004300b: Data Flow Task: "component "Destination - Money0808" (74)" wrote 0 rows.
(SQL Server Import and Export Wizard)
上面是导入时产生的错误日志,请帮忙看看什么原因
Messages
Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column " 0天->80天" returned status value 4 and status text "
Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)