Solved

Dynamic Output in SSIS

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

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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…
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 documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now