RE: Results to Variable

Tech-Archive recommends: Speed Up your PC by fixing your registry



Todd,

I thought of that, but I don't think it would work for me. The difference
between 2 and 3 is only one database (same SQL Server). The first one is
using ProdCatalog, another - ProdCatalogSwitch. I'm utilizing Data Source
View for both; thus, I wasn't able to use variables/parameters in the SQL
Code.

I would love to use LEFT OUTER JOIN ? (NOLOCK) instead of LEFT OUTER JOIN
ProdCatalog..estore_domain or ProdCatalogSwitch..estore_domain.

If there is a way to do this, I would love to implement it - it would save
me some development time!

Thanks,

Pasha


"Todd C" wrote:

Hello Pasha:

Glad to hear it worked!

By the way, there might be a more efficient way to do this: Are your Data
Flow tasks similar, but just pulling from different Sources? If so, you can
probably combine them into one Data Flow and set up Package Configurations to
determine which Database to connect to at run time.

Do this: Create a database called SSIS_Configurations (or similar). Add this
database as a Connection Manager to your Package. Right-click on the Control
Flow and select Package Configurations. Create a new configuration for the
*SOURCE* database. Set it up as a SQL Server configuration and saved in the
SSIS_Config Db. Save the Connection String of that source Db in the
configuration.

Now, at run time, the package will read the SSIS_Config Db and get the
Connection String of the Source database. Simply editing the entry that was
made and you get a whole new Source DB.

The advantage: You can use the SAME Data Flow task with all its transforms.
Also, you can have configurations for Dev, Test, and Production.

Package Configurations are VERY powerful in SSIS.

HTH.
--
Todd C

"Pasha" wrote:

Thanks Todd! That was the way I did it!


--
Thanks,

Pasha


"Todd C" wrote:

From your description, I assume that you are using SSIS 2005?

The element that gets the one record should be a Execute SQL Task, not a
data flow. In that task, you can define a Result Set (as a single row) and
map that result set to Package level varialbes. Then on the Control Flow, in
the Constraint lines that connect the SQL Task with the other Data Flows (2
through whatever) you set up Precedence Constraints to check the value of the
Variable(s).

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"Pasha" wrote:

Hi All,

Here is my scenario:

I execute a Data Flow Task, that returns only 1 row and one column. I would
like to assign that result to a variable. Then, based on that variable (or
result), I would like to execute either Data Flow Task 2 or Data Flow Task 3.
For example, if the result of Data Flow Task 1 is 'Source A', I execute Data
Flow Task 2 and if it is 'Source B', then I execute Data Flow Task 3.

What would be the best way to do it?

--
Thanks,

Pasha
.



Relevant Pages

  • Re: Updating existing records
    ... "Allan Mitchell" wrote: ... Before the Data Flow task I would TRUNCATE the staging table. ...
    (microsoft.public.sqlserver.dts)
  • Re: Updating existing records
    ... Before the Data Flow task I would TRUNCATE the staging table. ... After the data Flow task we use an ExecuteSQL task to simply issue a TSQL UPDATE statement. ...
    (microsoft.public.sqlserver.dts)
  • Re: SSIS Configuration problem
    ... I'll keep trying for a little while, but am getting close to a re-install of ... Clicking on "Click here to add a new Data Flow task" in Data Flow pane gives ... I've spent 24 hours trying to fix this problem - completely uninstalling and ...
    (microsoft.public.sqlserver.dts)
  • Re: SSIS Configuration problem
    ... You say that you have uninstalled and installed multiple times. ... Clicking on "Click here to add a new Data Flow task" in Data Flow pane gives ... I've spent 24 hours trying to fix this problem - completely uninstalling and ...
    (microsoft.public.sqlserver.dts)
  • RE: Results to Variable
    ... Flow and select Package Configurations. ... You can use the SAME Data Flow task with all its transforms. ...
    (microsoft.public.sqlserver.dts)