Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamic Output in SSIS

Posted on 2008-06-18
4
Medium Priority
?
552 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
[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
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 1500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

609 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