?
Solved

SSIS multiple Destination tables

Posted on 2009-07-02
3
Medium Priority
?
422 Views
Last Modified: 2013-11-10
i have to import multiple text files with same schemea format
into different destination tables..
bUT I think SSIS Cannot create destination tables on the fly..if this is the case,
 can we not load the data into a single
table intially and then split them into different tables based on the filenames
with the help of some stored procudure or .net code ?
can anybody please help me.. Many Thanks
0
Comment
Question by:gvamsimba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24761734
You can try store the tablenames you want to create in a table and use a stored procedure to create the tables... try it!
Pedro
www.pedrocgd.blogspot.com
0
 

Author Comment

by:gvamsimba
ID: 24762004
thanks pedro, can u please give me that dynamic stored procedure
for just 2 tables say file1 and file2..and if possible can u also
let me know if can add that SP in the SSIS package ?
many thanks..
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 2000 total points
ID: 24763006
CREATE PROCEDURE usp_createtable_dinamic
      @myTable as varchar(30)
AS
DECLARE @SQL nvarchar(max)
 
    SET @SQL='CREATE TABLE ' + @myTable + '       
      (ID int NULL,
      [Volume] [int] NULL,
      [AdditionalData] [varchar](50) NULL
) ON [PRIMARY]'
EXEC(@SQL)
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question