Import Text File in SSIS

importing data from flat text file into Sql Server using SSIS.

  • Step 1 : First right click on SSIS Package , select ” Add ” , next select “New Item ” then press Enter.
step 1
  • Step 2 : click “New SSIS Package” to create a new SQL Server Integration services (SSIS ) package .
step 2
  • step 3 : drag and drop ” Data Flow Task ” inside ” Control Flow ” .
step 3
  • step 4 : drag and drop “Flat File Source” into “Data Flow” and then right click to open ” Edit ” .
step 4
  • step 5 : click “Browse ” button to import the file from laptop .
step 5
Flat file records
  • step 6 : After browsing , select the text file ( Max ) . In your system
  • It may be different .
step 6
  • step 7 : Open Flat File Connection Manager Editor . click Columns tab to check the records inside text file and then click OK.
step 7

step 8 : click “Advanced” then you can easily Configure the properties of each columns .

step 8
  • click ” Columns ” , you can find Available External column and output column .
step 9
  • step 10 : drag OLE DB Destination into “Data Flow ” , link between Flat File Source and OLE DB Destination . right click and Edit “OLE DB Destination “
step 10
  • step 11 : configure OLE DB Connection Manager . i already have Data connections “localhost.Adam.sa1″ . Data Source ” localhost ” initial Catalog ” Adam ” Provider “SQLNCL11.1 ” User ID sa.
step 11
  • step 12 : Here after , you can find “OLE DB Destination Editor . select Connection Manager , OLE DB connection manager ” localhost.Adam.sa1 ” Data access mode ” Table or view ” , Name of the table or the view “[dbo].[TabTest] ”
  • ( in your case,it might be different )
step 12
  • step 13 : Drag and drop pile line of input column and Destination column .
step 13
  • step 14 : Run the Mapping, 7 rows from flat file source that load into OLE DB Destination (Sql server database ) .
step 14
  • step 15 : execute the query of destination table. you can get all records from text file loaded into sql server .
step 15

Happy coding , if any doubt, leave your comment. thanks …..

Post Author: adama

1 thought on “Import Text File in SSIS

    Lin Tina

    (11/17/2019 - 5:17 pm)

    I enjoy, cause I found exactly what I was taking a look for. You’ve ended my four day long hunt! God Bless you man. Have a great day. Bye|

Comments are closed.