Solved

Dynamic Output in SSIS

Posted on 2008-06-18
4
522 Views
Last Modified: 2013-11-30
In SQL 2000 DTS I am able to build a database from a series of flat files and name the database based on some dynamic/global variables through DTS (see snippet below) how can i accomplish this same task in SSIS and SQL 2005?

 SET @cmd='master..xp_cmdshell ''DTSRun /S "' + @Server + '" /U "user" /P
"password" /N "hk_import_tempBook_' + @Person + '" /A "gv_destDB:8=HTML_' +
@CompanyID + '_' + @BookCode + '" /A "gv_destDBtable:8=[HK_' + @CompanyID
+ '_' + @BookCode + '].[dbo].[temp_Book]"'', no_output'
  EXEC (@cmd)

or can i just run these all under the legacy area of SQL 2005?
0
Comment
Question by:ChrisMoreland
  • 2
4 Comments
 
LVL 8

Expert Comment

by:sbagireddi
ID: 21817176
You can use the DTS Migration Wizard if you do not want to create the package using SSIS.
But some components may not work.
But you can try and see if it works.
0
 

Author Comment

by:ChrisMoreland
ID: 21817365
The problem is the The SQL Server 2005 Integration Services (SSIS) Package Migration Wizard does not migrate Dynamic Properties tasks in SQL Server 2000 Data Transformation Services (DTS) packages. and this keeps me from createing the global variable gv_destDB.
0
 
LVL 8

Expert Comment

by:sbagireddi
ID: 21817569
There is no dynamic property task in Sql server 2005.

Instead look at SSIS expressions and Configurations.

this may helps as well:

www.sqlis.com
0
 
LVL 15

Accepted Solution

by:
rob_farley earned 500 total points
ID: 21818529
Use Expressions on your Connection Manager. So... I assume you're doing something like a ForEach Enumerator, populating a variable with the name of the file... So in your Flat File Source ConnectionManager, set the ConnectionString to be based on an expression that uses the variable, and in your OLEDB Destination ConnectionManagaer, set the ConnectionString to use the appropriate database.

Or if it's just the table you're needing to tweak, then you can set it to a variable in the OLEDB Destination component. You may need to put a script component in the ControlFlow (in the ForEach Component) to set the variable appropriately before calling the Data Flow.

But... the design of the table must be the same as all the rest. The flow through a table has to be identical. If you're needing to pull a bunch of different files through, then do a Bulk Insert task which uses Expressions instead.

Rob
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
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…

837 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