Solved

SSIS multiple Destination tables

Posted on 2009-07-02
3
419 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 500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help with another query 10 38
SQL Syntax 6 41
access to sql migration 5 24
Sql server Error message 3 16
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
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.

733 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