Solved

Dynamic Output in SSIS

Posted on 2008-06-18
4
514 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Viewers will learn how the fundamental information of how to create a table.

773 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