Solved

SSIS multiple Destination tables

Posted on 2009-07-02
3
413 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
  • 2
3 Comments
 
LVL 22

Expert Comment

by:PedroCGD
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now