使用ssis将文本文件加载到sql server时如何避免使用额外的逗号 [英] how to avoid extra commas while loading text file to sql server using ssis

查看:124
本文介绍了使用ssis将文本文件加载到sql server时如何避免使用额外的逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我对ssis有一个疑问

如何在ssis中加载额外的commaseparate行

我想加载文本文件数据加载到sql server表中 
emp.txt文件中的
包含以下数据 

id,name,sal,deptno

1,ab,10,20

2,b,20,30

3,h,y,30,50

4,x,40,50

6,ab,xy,30,50



sql server table:

table emp:(id int,name varchar( 50),sal money,deptno int)

id,name,sal,deptno



基于文本文件我想将数据加载到sql中像下面的服务器表

id | name |萨尔| deptno

1,| ab    | 10 NBSP;   | 20

2  | B    | 20    | 30

3  | H,Y  | 30    | 50

4  | X    | 40 NBSP;   | 50

6  | AB,XY | 30    | 50 zh


我试过如下 

Hi I have one doubt in ssis
how to load extra commaseparate rows in ssis
I want load text file data load into in sql server table 
in emp.txt files have data like below 
id,name,sal,deptno
1,ab,10,20
2,b,20,30
3,h,y,30,50
4,x,40,50
6,ab,xy,30,50

sql server table :
table emp:(id int,name varchar(50),sal money,deptno int)
id,name,sal,deptno

based on text file I want load data into sql server table like below
id |name | sal | deptno
1, |ab   |10   |20
2  |b    |20   |30
3  |h,y  |30   |50
4  |x    |40   |50
6  |ab,xy|30   |50

I tried like below 


$


但名称值进入sal列



你能告诉我如何完成这项任务,以避免ssis中的额外通信 



$







but name values came into sal column

can you please tell me how to achieve this task to avoid extra comms in ssis 





推荐答案

当你使用逗号作为分隔符时,不应该使用逗号如果凝视数据中有逗号,则生成文本文件。
You should not use the comma as the delimiter when you generate the text file if there is a comma in the staring data.


这篇关于使用ssis将文本文件加载到sql server时如何避免使用额外的逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆