How to create SSIS Package

If you are new to SSIS and would like to create your first SSIS package then below is a simple example with step by step instructions which will show you how to create an SSIS package in bids. I will use SQL Server Integration Services 2008 R2 and Visual Studio 2008 (instructions should be very similar for 2008 and 2005). This tutorial is for beginners and will not be following best practise which includes using variables and package configuration. At the end of tutorial I will post extra materials (once I create them) which will include best practise and package deployment.

If you need SSIS Overview before you start than please visit the following link SSIS Package

 

Note: We have video version of this tutorial. Please click the button below otherwise scroll down to read text based tutorial.

Subscribe to me on YouTube


Create SSIS Package – Purpose

The purpose of this package is to load employee data from a CSV file into SQL Server database new employee table.
 

Create SSIS Package – Prerequisites

In order to complete this tutorial you will need:

  • SQL Server 2008 R2 with default localhost instance and BIDS (should work on 2008 and 2005)
  • Employee CSV file which you should save in location you will remember. Download Employee CSV file

How to create an SSIS Package

First create SSIS Project using BIDS (For more information visit Create SSIS Project)

Below is example of an empty package. I have highlighted the elements we will use and briefly discuss it below (you can ignore the rest):
create ssis package empty

Solution Explorer - on the right you see solution explorer with your SSIS project (first icon from top). If you don’t have it go to view//solution explorer. In majority of cases you will use SSIS Packages only. The rest is not used in practise (best practise).
Package tab - In middle we have our ‘package.dtsx’ opened which contains control flow, data flow that we will use.
Toolbox - This shows ‘tools’ (items/tasks) that we can use to build our ETL package. Toolbox is different for control flow and data flow tabs in the package.
Control Flow - Here you will be able to control your execution steps. For example you can log certain information before you start the data transfer, you can check if file exists, and you can send an email when a package fails or finishes. In here you will also add a task to move data from source to destination however you will use data flow tab to configure.
Data Flow - This is used to extra source data and define destination. During the "data flow" you can perform all sorts of transformation for instance create new calculation fields, perform aggregations and many more.

Let’s get to work.
Make sure you are in control flow tab in SSIS Package designer and in the toolbox find data flow and drag into empty space in control flow pane.
Right click ‘data flow task’ that you dragged and rename it to ‘Employee Load’ (and hit enter to get out from edit mode)
create ssis data flow item
Double click it ‘Employee Load’ data flow (ensure the box is not selected; otherwise double click will work like rename). Notice that SSIS automatically goes to data flow task where you can configure the data flow.
See below screenshot. Which shows that we are not in Data Flow tab and notice the data flow task drop down box which says ‘Employee Load’. You can have multiple data flow items in control flow so this drop down box allows you to change it.
From the toolbox (while in data flow tab) drag ‘FlatFile Source’ into empty space.
Right click the source and select rename. Type ‘Employee CSV Source’.
add text file source
Double click the ‘Employee CSV Source’. A dialog box will appear with header name 'Flat File Source Editor'.
Next we will create SSIS Package connection which will be stored in the package and will connect to the CSV file. In order to that click the New… button.
Type the connection manager name and description
Click browse button and find the employee.csv file (by default you will see on *.txt file change it *.csv files)
Once you back ‘tick’ Column names in the first data row
You should the warning that states that you columns are not defined. Simply click columns which will set it for you (default settings should be fine).
OK button should be enabled now so click it to complete the process.
On the first dialog box connection manager should say ‘EmployeeCSV’ click OK to close the dialog box.
configuring csv source
Now from the toolbox let’s drag OLE DB destination into data flow empty space and rename it to ‘Employee Table’ (OLE DB Destination in toolbox is in Data Flow Destination tab in toolbox…. I thought I will clarify that as it is easy to pick OLE DB source which is not what we want.)
create ssis data flow item
Now we are going to create ‘data path’ which means that we define source and its destination. We will do that by clicking source (once). You should see green arrow. Click it (once or press and hold) and move it over destination (click or release mouse). You created "data path" in SSIS Package (Data Flow).
connect source to destination
Double click ‘Employee Table’ Destination.
Create new connection by clicking ‘new…’ button and new… button again on another dialog box pops up.
Put server name. If you are connecting to local server type localhost
Select database from drop down box and click OK on all dialog boxes to confirm your choices.
create connection to sql server
Now that new connection is selected. We will create destination table. Notice that I highlighted data access mode with value table or view – fast load this is an important value that makes the load very quick, make sure you remember this one.
To create new table click New… for the table/view drop down box (see below), change the table name to [Employee] and click ok.
To finish the process click mappings that will create mapping between source fields and destination fields and click OK
configure destination item
Let’s test our SSIS Package. Click run (play button on toolbar). And you should see that extract from source worked (green), arrows should show 2 rows from our CSV file and destination should also go green which means it successfully loaded 2 rows from the file.
run ssis package
I hope you found this tutorial useful. If you have any questions or comments feel free to post them below.

Take care
Emil


SHARE:


Name: Gaurav
Comment: Nice Tutorial Keep it up....
Date Posted: 08/07/2011 7:06:24 AM

Name: Yogesh
Comment: Good ansd Simple
Date Posted: 15/07/2011 10:53:32 AM

Name: LT
Comment: Awesome simple example...I think you example is the VERY 1st that is quick, concise and easy to understand. For that, I say bravo!
Date Posted: 02/09/2011 2:26:40 PM

Name: sigov
Comment: g8t article, working fine..
Date Posted: 09/09/2011 10:58:20 AM

Name: ram
Comment: very useful.
Date Posted: 09/09/2011 11:00:44 AM

Name: Emil
Comment: Thanks everyone for comments. I'm glad you find it simple and easy to follow. As you like it I will try to write more articles how to create SSIS packages with different sources and destinations soon!
Date Posted: 09/09/2011 8:19:04 PM

Name: Jitendra Kumar
Comment: Thank Emil, This is very good article. please keep it up.
Date Posted: 13/10/2011 8:52:18 AM

Name: Shilpa
Comment: Hai , this is really very useful article......no one before said this simple about creating ssis pacakge..... Thanks to you, shilpa.
Date Posted: 14/10/2011 6:42:08 PM

Name: Tara Kant
Comment: Very useful for beginner whoever in SSIS
Date Posted: 09/11/2011 6:49:49 AM

Name: Lipsa
Comment: Really..very useful article..Thanks!!!
Date Posted: 16/11/2011 6:27:13 AM

Name: Bharathi Maddela
Comment: Very useful for beginners like me thanks
Date Posted: 24/11/2011 11:38:57 AM

Name: Emil
Comment: Thank you for your comments and special thanks to Katie for finding several errors and unclear instructions and Mark for finding broken links (How to create SSIS Project).
Date Posted: 26/11/2011 10:02:23 AM

Name: BEZAY
Comment: very nice dude... it is really helpful and easy way to understand ..! thank u so mnuch
Date Posted: 27/11/2011 2:42:10 PM

Name: Dhinesh babu
Comment: It is very nice. Thanks.
Date Posted: 28/11/2011 2:23:31 PM

Name: Csaba
Comment: Hi Emil, Nice tut, thanks... that was very useful I would bet you are Hungarian :) csaba
Date Posted: 21/12/2011 12:29:23 AM

Name: srividhya
Comment: Very useful thanks for posting this
Date Posted: 23/12/2011 4:29:12 AM

Name: vks
Comment: thanx..:) its useful
Date Posted: 30/12/2011 2:37:32 PM

Name: venkat
Comment: hi how to rectify the duplicate records in .csv file without using sort transforamtion
Date Posted: 05/01/2012 8:39:50 AM

Name: Demir from Turkey
Comment: Nice clean tutorial. Thanks
Date Posted: 09/01/2012 1:59:09 PM

Name: Krishna batham
Comment: This tutorial help me so much for learn how to create ETL package.Thanks for that
Date Posted: 11/01/2012 12:55:26 AM

Name: kavitha
Comment: Very useful post to start with SSIS. Thank you
Date Posted: 16/01/2012 2:00:51 PM

Name: Mike
Comment: Very good!
Date Posted: 18/01/2012 2:34:29 AM

Name: Hari
Comment: Thanks this is very usefull. And how to extract from execl to database.
Date Posted: 18/01/2012 6:47:24 AM

Name: Nirvit Jani
Comment: Hi. Great work man. however people get confuse between OleDB Source and OLEDB Destination. they can get ole db destination from Data flow deatination panel in toolbox.
Date Posted: 19/01/2012 11:02:12 AM

Name: Abhash Bhardwaj
Comment: Hi This Helped me a lot.
Date Posted: 24/01/2012 5:49:48 AM

Name: Mahesh
Comment: Thanks... Iam new to sql...Iam starting learning ..
Date Posted: 24/01/2012 12:52:47 PM

Name: Terrence
Comment: Hi,A few small errors. But its so simple I couldn't get lost. I just learnt something usefull in half an hour. Thanks for taking the time to post a great article.
Date Posted: 25/01/2012 8:29:55 AM

Name: Emil
Comment: Thanks for so many great comments. I will try to add email address for posting comments so I can reply to you and if you find any errors on the page, please let me know I'll be happy to correct it. p.s. I'm not from Hungary but from Poland living in UK for a few years now.... and still making plenty of English errors ;)
Date Posted: 30/01/2012 9:51:08 PM

Name: Darvesh
Comment: "SSIS in a nutshell" - is what I call this article. Awesome, keep up the good work that helps many.
Date Posted: 03/02/2012 4:30:55 PM

Name: TEst
Comment: Bad Sample.........................
Date Posted: 06/02/2012 1:19:40 PM

Name: Chandrashekar
Comment: Good One. Thanks a lot.
Date Posted: 08/02/2012 9:53:44 AM

Name: Ramesh
Comment:

Simply Super... wonderful post to start with...


Date Posted: 10/02/2012 10:46:37 PM

Name: Swamynathan
Comment:

Superb. Could get along with the steps easily. Pakka work!! Keep it up!!!


Date Posted: 13/02/2012 7:28:55 AM

Name: Rajchandar
Comment:

Nice article, good job, well done and keep it up.

Thanks & Regards,

Raj

 

 

 


Date Posted: 13/02/2012 2:34:26 PM

Name: Venkatesh
Comment:

Good One. Thanks


Date Posted: 15/02/2012 12:39:51 AM

Name: Ree
Comment:

nice article


Date Posted: 15/02/2012 7:32:45 PM

Name: Shaik
Comment:

Thanks for the nice and simple article for beginners.


Date Posted: 16/02/2012 11:50:39 AM

Name: Viet
Comment:

I don't see Flat File Source under Data Flow Sources.  All others such as ADO NET Source is there.  Anyone has any idea why?


Date Posted: 16/02/2012 5:53:01 PM

Name: Viet
Comment:

Nevermind, I did Reset Toolbox (right-click inside Toolbox area) and it now shows up.


Date Posted: 16/02/2012 7:01:42 PM

Name: shilpa
Comment:

hi,

 

  Very nice article.


Date Posted: 17/02/2012 7:10:39 AM

Name: Ashwin
Comment:

I need help that i want to import data to sql server from excel workbook which consists of multiple sheets.... the data should be normalised befor storing into the SQL database. could you please send with neat screenshots


Date Posted: 21/02/2012 11:36:44 AM

Name: Mehajabeen
Comment:

Hi Emil ,

  A very simple and good example for beginers . After browsing a lot on google I found this example to start with . Thanks a lot .

  I was finding very difficult to dump data from csv file to sqlserver 2008 . I was dumping data from csv to Sqlserver 2005 first and from there i used to import data to sqlserver 2008 . This will stop me from doing double work .

Jabeen
 


Date Posted: 22/02/2012 12:47:45 PM

Name: Mandar
Comment:

Thanks for well organised tutorial.


Date Posted: 27/02/2012 6:22:55 AM

Name: Kalyan
Comment:

Emil,

 

Your blog is very useful for begginers like me. Keep it up.

 

Thanks,

Kalyan Basa


Date Posted: 28/02/2012 12:34:57 PM

Name: Vivek
Comment:

Hey this was helpful.

thank you.


Date Posted: 28/02/2012 2:29:11 PM

Name: John Jebastin
Comment:

Very useful for the starters... Good tutorial.


Date Posted: 28/02/2012 4:48:24 PM

Name: Bonzer
Comment:

AweSome Tutorial, very Clear and Precise.

 

Thanks

A


Date Posted: 08/03/2012 9:54:30 PM

Name: Naveen
Comment:

Ok


Date Posted: 14/03/2012 6:49:09 AM

Name: Venkatesh
Comment:

Good


Date Posted: 15/03/2012 11:29:23 AM

Name: Michelle
Comment:

Thank you! Loved your tutorial. I will be looking for more from you to help me get a better understanding of sql and ssis.


Date Posted: 15/03/2012 4:32:38 PM

Name: Subhra
Comment:

Really helpful in creating SSIS packages for dataflow.


Date Posted: 20/03/2012 1:46:36 PM

Name: Ramya
Comment:

Hi, Thanks Lot.. This help me to understand easily.

 


Date Posted: 21/03/2012 8:24:52 AM

Name: loreen
Comment:

Looking forward for more tutorial :)

Thanks


Date Posted: 28/03/2012 9:55:57 AM

Name: ashokkumar
Comment:

great article, its awesome. very simple, neat explanations and its very useful to learner.


Date Posted: 10/04/2012 11:03:48 AM

Name: Taruna
Comment:

Very precise and helpful tutorial.

 

Thanks

 


Date Posted: 19/04/2012 12:52:50 PM

Name: TARUNA
Comment:

Hi

I  was trying to import the data from csv file to excel using the concept of SSIS but could not complete, facing problems. Pls help.

 

 

Thanks

Taruna


Date Posted: 19/04/2012 2:04:21 PM

Name: Emil
Comment:

Hi Taruna,

Could you share your problem when you try to use create an ssis package to import data from CSV and Export to Excel?

The typical problems I know of are CSV doesn't handle double quotes very well, Excel 64bit can cause some issues.

Personally I don't use Excel as destination. Normally I push data into database (data warehouse in my case) and export using SSRS.


Date Posted: 20/04/2012 5:55:45 AM

Name: Taruna
Comment:

Hi Emil

Thanks for your concerns , i have made it pending to experiment on transfering the data from CSV to Excel.

 

But my urgent need is to transfer the data from an excel sheet to SQL server database.

But while defining the properties for the destination sql server , it tells no input columns are available but when i was setting the connection for the source excel sheet, it showed me all the columns, can u help on this?

it wud be a great help as u always does.

 

thanks

Taruna

 

 


Date Posted: 20/04/2012 1:13:54 PM

Name: Emil
Comment:

Hi Taruna,

It sounds like it might be easy to fix:

1) Ensure you have excel source and that you can connect to OLEDB destination using arrow (so called "data path" to be precise). Only if you do that you can see columns.

2) If that is not the cause ensure that you have columns select in source (double click and go to column... I think)

That should help.... if you are using 64bit machine with excel you might find that when you try to run package (after you finish set up) it gives you an error. Go to project properties in solution explorer and there is somewhere option that says somethin like "run in 64bit" change that to false.

I hope that helps

Emil

 


Date Posted: 21/04/2012 10:19:45 AM

Name: Nids
Comment:

It was really good and simple to understand.. could you please share more similar links.


Date Posted: 23/04/2012 7:13:35 AM

Name: Taruna
Comment:

Hi Emil

 

Thanks First of all, Your guidance was such a great help.What i was doing wrong is: i was using different data flow tasks for source and destination.

 

 

Thanks


Date Posted: 23/04/2012 12:03:19 PM

Name: Prabhu
Comment:

Please add how to do transformations through SSIS - Dot Net code view


Date Posted: 25/04/2012 1:23:16 PM

Name: Baseer
Comment:

very nice,it gives clear picture for the beginners, Thanks lot


Date Posted: 30/04/2012 10:35:45 AM

Name: sumit
Comment:

A comlete reference with screen shorts which help the developers easy to understand and apply the same with better options for any projects.

 

Regards,

Sumit


Date Posted: 10/05/2012 8:25:22 AM

Name: Chris
Comment:

I thought I was the best Tutorial writer, and you proved me wrong!  Excellent job at creating simple and yet effective tutorial.  THANK you.


Date Posted: 12/05/2012 8:38:30 PM

Name: ras
Comment:

very good


Date Posted: 15/05/2012 8:15:48 AM

Name: vijay
Comment:

very nice.


Date Posted: 21/05/2012 2:46:56 PM

Name: Ricky
Comment:

Very Good.

Could floating adverts be placed on the left-hand side?


Date Posted: 23/05/2012 1:03:56 PM

Name: Emil
Comment:

Hi Ricky,

Thanks for your comment. We are working on new website design (check our twitter account) and the ads should hopefully be less intrusive, although the one on the right will most likely stay as it is main one that "sponsors" our articles; mainly covers running costs but hopefully in the future we will be able to take some time off after I finish my onsite contract so we can write many more hopefully good quality tutorials.

Regards

Emil


Date Posted: 24/05/2012 6:55:26 AM

Name: Emil
Comment:

Hi Ricky,

We implemented new design and the right side ad stayed for larger resolutions but we removed for resolutions where width is below 1280px.

We hope this will improve experience visitors that use lower resolutions.

Regards

Emil


Date Posted: 25/05/2012 8:09:03 PM

Name: Sivalakshmi
Comment:

Thank you so much

It is user understandable


Date Posted: 31/05/2012 9:31:35 AM

Name: kiran
Comment:

nice explination for the lerners


Date Posted: 01/06/2012 10:50:32 AM

Name: Deepayan
Comment:

Awesome blog...!!!!!


Date Posted: 02/06/2012 9:05:09 AM

Name: Dinesh
Comment:

Very useful tutorial...


Date Posted: 07/06/2012 5:59:18 AM

Name: Siva
Comment:

Thanks, it is very helpful to start with this example. 


Date Posted: 12/06/2012 2:14:39 PM

Name: Tapas
Comment:

Please remove microsoft Advertisement from right side of web pages. it do not allow to read right side of ur pages. or place it somewhere else


Date Posted: 13/06/2012 9:16:00 AM

Name: shubhra
Comment:

Good 1 katie.


Date Posted: 27/06/2012 5:30:03 AM

Name: star21
Comment:

Thank you much this is very helpful on my first attempt to study SSIS. fantastic

 


Date Posted: 01/07/2012 7:03:05 AM

Name: Gangadhar
Comment:

Very good and useful content

 


Date Posted: 17/07/2012 9:01:16 AM

Name: Indy
Comment:

Very easy to understand with the way you have laid it out. Thanks!


Date Posted: 25/07/2012 5:53:57 PM

Name: Yogesh
Comment:

very nice & much in details for beginer.

Thanks


Date Posted: 16/08/2012 7:01:42 AM

Name: PRABHU SANKAR
Comment:

Awesome explanation for learners.

Thanks a lot for the tutorial.


Date Posted: 23/08/2012 12:47:27 PM

Name: Joshua
Comment:

it's understandable, clear tutorial....Thanx


Date Posted: 28/08/2012 11:57:01 AM

Name: saman
Comment:

useful article .thanks......


Date Posted: 30/08/2012 7:13:01 AM

Name: Prashant
Comment:

Simple and superb article.Thanks a lot Emil.

Prashant


Date Posted: 13/09/2012 10:31:25 AM

Name: Priya
Comment:

how v can acess multiple excel source file to a destination data base?

 


Date Posted: 21/11/2012 11:17:27 AM

Name: Emil
Comment:

Hi Priya

It depends on the Excel Files. If there are the same structure files than most likely for each loop is best and if they are related spreadsheets then merge join might be best.

Check our YouTube Channel for Excel Source / Destination and Merge Join Transformation. We will add For Each Loop soon.

Regards

Emil


Date Posted: 25/11/2012 7:27:16 AM

Name: Rony
Comment:

Nice post... good one for beginners..

Thanks, 


Date Posted: 30/11/2012 1:16:51 PM

Name: hoacoi88
Comment:

Thanks you very much, lesson is great


Date Posted: 24/02/2013 3:06:22 AM

Name: Maria Lewis
Comment:

HI Guys, would you be able to help...i need to create a new project, and a package calling astored procedure that I wrote . The procedure will populate a table and the results of the table will be emailed to me on daily bases. How do I call the stored procedure? I am missing a link in my attempts

Thank you kindly


Date Posted: 27/05/2013 1:12:31 PM

Name: Emil
Comment:

Hi Maria,

You can use execute sql task, do a search on our website to find a video our search our YouTube Channel.

Take care

Emil


Date Posted: 27/05/2013 10:42:05 PM




Disclaimer: While every caution has been taken to provide our readers with most accurate information and honest analysis, please use your discretion before taking any decisions based on the information in this blog. Author will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.