SQL Server Integration Services (SSIS) – Part 17 – Create/Delete a table in SQL using SSIS

Posted by in Sql Server category on for Intermediate level | Points: 250 | Views : 19200 red flag
Rating: 4.5 out of 5  
 2 vote(s)

This is part 17 of the series of article on SSIS and shows how to create/delete a table in SQL using SSIS.

 Download source code for SQL Server Integration Services (SSIS) – Part 17 – Create/Delete a table in SQL using SSIS


In this article we are going to see on how to run a query from SSIS. Mainly create or delete a table from SSIS package. We have a task called Execute SQL Task in SSIS which helps us to do this task. Let’s see on how to use this task and create a table using SSIS. This task will be mainly used in scenario like if at all we need to check if table exists or not and to create a table using this task.

To follow my series of articles on SSIS packages refer to the below URL’s

SSIS Series Part 1 to 16


Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use Execute SQL task and create a table using the same.

I just dragged and dropped the execute SQL task as shown in the above image. Double click on it will open the configurations tab as shown below

Here we need to configure the connection and the SQLStatement. Here the statement we are going to execute is a create table statement as shown in the below code

CREATE TABLE [dbo].[EmployeeTable]([EmpID] [int] NOT NULL, [EmployeeName] [nvarchar](100) NULL, [EmpDesignation] [nvarchar](100) NULL, [EmpAge] [int] NULL,) ON


Now we are confirmed that the configuration is done and ready to run the package

Press F5 will build and execute the package as shown in the below screen

The output of the package is the creating of table Employeetable in Northwind Database. Just go to the SSMS and query the table Select * from Employeetable we will see the table with no recrods as shown below

Similar way we can create an Execute SQL task in order to delete the table with the same structure.


So in this article we have seen on how to use the Execute Sql task container to Create or Delete a table from SSIS packaging.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Karthikeyan Anbarasan
Member Level: Silver
Member Status: Member,Moderator,Microsoft_MVP,MVP
Member Since: 1/2/2011 3:00:14 AM
Country: India
Thanks Karthik www.f5Debug.net
www.f5Debug.net Around 5 years of experience in Microsoft technologies like ASP.Net, VB.Net, C#.net, SQL server, Biztalk Server, WCF, WPF, SSIS, SSRS, SSAS, AJAX and working as Senior Analyst in a US based MNC.

Login to vote for this post.

Comments or Responses

Posted by: Tripati_tutu on: 3/7/2011 | Points: 25
Nice one.
Posted by: Karthikanbarasan on: 3/7/2011 | Points: 25
Thanks Tripathi

Login to post response

Comment using Facebook(Author doesn't get notification)