[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SSIS multiple Destination tables

Posted on 2009-07-02
3
Medium Priority
?
424 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

656 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