SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating tables on the fly with SSIS


Creating tables on the fly with SSIS

Author
Message
Source-NH
Source-NH
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1721 Visits: 479
Ermm Phil, my apologies.

Should have tried it a little more before I ASSUMED that SSIS would be logical. Guess it's not as straight forward as I thought.

Rich
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18330 Visits: 20413
Rich-403221 (8/11/2010)
Ermm Phil, my apologies.

Should have tried it a little more before I ASSUMED that SSIS would be logical. Guess it's not as straight forward as I thought.

Rich


No problem - and you learned something along the way, which is good :-)

SSIS is logical ... but perhaps it becomes so only after spending a lot of time with it. At some point, the philosophy 'clicks' and after that it becomes your friend.

Phil


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Source-NH
Source-NH
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1721 Visits: 479
Agreed. But, I have spent a fair amount of time with it, just sometimes forget that there are some "quirks" that can get in the way of doing something which should be relatively straight forward.
vinu512
vinu512
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1687 Visits: 1625
Phil Parkin (8/11/2010)
Rich-403221 (8/11/2010)
Ermm Phil, my apologies.

Should have tried it a little more before I ASSUMED that SSIS would be logical. Guess it's not as straight forward as I thought.

Rich


No problem - and you learned something along the way, which is good :-)

SSIS is logical ... but perhaps it becomes so only after spending a lot of time with it. At some point, the philosophy 'clicks' and after that it becomes your friend.

Phil


Hi Phil,

Sorry for hijacking the thread. had this posted for almost a week without any luck so thought someone from this thread might be able to help.

I was working on an SSIS project in which I need to:

1. Loop through a folder containing multiple text files and get their name into a variable.
2. Append the current system date to that variable so that the variable now contains txtfilename + Date.
3. Create a table in the database with the name as value of the variable.
4. Transfer data of the txt file into the newly created table.


The first two steps I accomplished using a For Each Loop Container and i am able to get the file name into the variable.
The second step I accomplished by just appending GetDate() to the value of the variable.
The third step I accomplished using an Execute SQL task for creating table.

What i am not able to do is get the data into the table with a Data Flow Task.
The problem is that it requires me to give table name as input, which i cannot as the table is being created by the same package dynamically. I need to automate this task so I would always have to create the table dynamically.

Please be patient enough to go through my problem and provide a solution. Thanks a tonne in advance.

PS: I am not very good with C# or other scripting languages so I won't be able to work with a
Scripting task in SSIS. So, please give me a solution other than scripting.

Vinu Vijayan

For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden ;-)
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18330 Visits: 20413
Will the tables all have the same DDL?

If not, this is practically impossible to do without C#/VB.NET coding. Unless you decide not to use data flows and instead code the imports using dynamic SQL. But if you go down that path, why not just do everything in a stored proc?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search