Import CSV into DB using SSIS

Step 1: create a table

CREATE TABLE [EmployeeImported](
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[ContactID] [int] NOT NULL,
[ManagerID] [int] NULL,
[Title] [varchar](100) NOT NULL,
[MaritalStatus] [char](1) NOT NULL,
[Gender] [char](1) NOT NULL,
[HireDate] [datetime] NOT NULL
) ON [PRIMARY]
GO

Step 2: open SQL Server Business Intelligence studio. Select Integration Services Project

 

 

Step 3: Click on Control Flow and drag Data Flow Task to the right side pan

Step 3: Double click on the Control Flow task.

Step 4:It will take you to Data Flow pan.

Step5:Drag Flat File Source from Toolbox to Data Flow task pan.

Step 6: Configure New Connection by clicking New.

Step 7: Select the Path of the file and specify Text Qualifier. For me the text qualifier is comma(,).

Step 8: Click on Columns and adjust OutputColumnWidth – match it with width of your original data. If you do not know leave it as default (at 50).

Step 9: Click on on following screen.

Step 10: Now Select OLE DB Destination from right side Toolbox and drag to below the Flat File Source.

Step 11: Put them near to each other ad demonstrated below.

Step 12: Connect Green Arrow of Flat File Source with OLE DB Destination.

Step 13: Double click on OLE DB Destination and connect to the database and table created earlier in the code.

Step 14: After configuring connection the mapping needs to be adjusted as well.

Step 15: Now on mappings tab connect both the size. I have not connected very first column as it is identify column for me.

Step 16: Clicking OK will bring me to following screen.

Step 17: Now click on F5 and it will execute the package in debug mode.

 

More Info please client below url:

http://blog.sqlauthority.com/2011/05/12/sql-server-import-csv-file-into-database-table-using-ssis/

 

转载于:https://www.cnblogs.com/vincentDr/p/3217409.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值