dbTalk Databases Forums  

Input Parameters in Tansform Data Tsk

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Input Parameters in Tansform Data Tsk in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bronz Fonz
 
Posts: n/a

Default Input Parameters in Tansform Data Tsk - 01-27-2005 , 01:01 AM






Hi,
I currently use Transform Data Task to load data into a tbl. The source data
is a select stmt. I'd like to make the db names used in the select stmt
dynamic/varaible. I've unsuccessully tried using input params in the sql stmt
(the source tab). Also considered using an SP for the select stmt to create
the source data, but the output is a very large rowset (performance issues)
and won't be be possible to use the Transform Data Task to move the data
(have to resort to ActiveX datapump!).

Any suggestions are apprecaited.

I have added simplified code representing my select stmt in the Transform
Data Task, for ease of illust:

SELECT dw.cus_key, staging.cus_order
FROM [datawarehouse]..[customer] dw
INNER JOIN [staging]..[order] staging)
--I want the 'datawarehouse' & 'staging' db names to be variable (i.e. set @
exe time via GVs, INI, etc)

TIA

MA

Reply With Quote
  #2  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Input Parameters in Tansform Data Tsk - 01-27-2005 , 06:59 AM






The quickest way is to put in some global variables in the package and then
in the transform data

select * from dbo.aktivitet_dim
where aktivitetskode = ? and aktivitet = ?

Then you need to active the parameters button in the transform data task and
select these according
to the order of use in your sql statement.

You could also store these variables in a sql table and then read and use
this in the package.



"Bronz Fonz" <Bronz Fonz (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I currently use Transform Data Task to load data into a tbl. The source
data
is a select stmt. I'd like to make the db names used in the select stmt
dynamic/varaible. I've unsuccessully tried using input params in the sql
stmt
(the source tab). Also considered using an SP for the select stmt to
create
the source data, but the output is a very large rowset (performance
issues)
and won't be be possible to use the Transform Data Task to move the data
(have to resort to ActiveX datapump!).

Any suggestions are apprecaited.

I have added simplified code representing my select stmt in the Transform
Data Task, for ease of illust:

SELECT dw.cus_key, staging.cus_order
FROM [datawarehouse]..[customer] dw
INNER JOIN [staging]..[order] staging)
--I want the 'datawarehouse' & 'staging' db names to be variable (i.e. set
@
exe time via GVs, INI, etc)

TIA

MA



Reply With Quote
  #3  
Old   
Bronz Fonz
 
Posts: n/a

Default Re: Input Parameters in Tansform Data Tsk - 01-27-2005 , 04:53 PM



Thanx for response Michael.
I'll add that the problem is with using an input param for DB names in the
SQL stmt. It seems a replacement of DB name with "?" doesn't work, whilst
using the "?" in a where clause (or perhaps after a comparison op.) allows
DTS to recognise the input param. Limitation of DTS i/p param?

"Michael Vardinghus" wrote:

Quote:
The quickest way is to put in some global variables in the package and then
in the transform data

select * from dbo.aktivitet_dim
where aktivitetskode = ? and aktivitet = ?

Then you need to active the parameters button in the transform data task and
select these according
to the order of use in your sql statement.

You could also store these variables in a sql table and then read and use
this in the package.



"Bronz Fonz" <Bronz Fonz (AT) discussions (DOT) microsoft.com> wrote in message
news:46604A3C-0901-4893-88BE-FE8CEDD344BC (AT) microsoft (DOT) com...
Hi,
I currently use Transform Data Task to load data into a tbl. The source
data
is a select stmt. I'd like to make the db names used in the select stmt
dynamic/varaible. I've unsuccessully tried using input params in the sql
stmt
(the source tab). Also considered using an SP for the select stmt to
create
the source data, but the output is a very large rowset (performance
issues)
and won't be be possible to use the Transform Data Task to move the data
(have to resort to ActiveX datapump!).

Any suggestions are apprecaited.

I have added simplified code representing my select stmt in the Transform
Data Task, for ease of illust:

SELECT dw.cus_key, staging.cus_order
FROM [datawarehouse]..[customer] dw
INNER JOIN [staging]..[order] staging)
--I want the 'datawarehouse' & 'staging' db names to be variable (i.e. set
@
exe time via GVs, INI, etc)

TIA

MA




Reply With Quote
  #4  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Input Parameters in Tansform Data Tsk - 01-29-2005 , 10:55 AM



Think you're right

I had some trouble at one point too but found out that when calling a stored
procedure from the execute sql task you can you use input parameters
for everything - not just where - statements.

Try this instead...


"Bronz Fonz" <BronzFonz (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanx for response Michael.
I'll add that the problem is with using an input param for DB names in the
SQL stmt. It seems a replacement of DB name with "?" doesn't work, whilst
using the "?" in a where clause (or perhaps after a comparison op.) allows
DTS to recognise the input param. Limitation of DTS i/p param?

"Michael Vardinghus" wrote:

The quickest way is to put in some global variables in the package and
then
in the transform data

select * from dbo.aktivitet_dim
where aktivitetskode = ? and aktivitet = ?

Then you need to active the parameters button in the transform data task
and
select these according
to the order of use in your sql statement.

You could also store these variables in a sql table and then read and
use
this in the package.



"Bronz Fonz" <Bronz Fonz (AT) discussions (DOT) microsoft.com> wrote in message
news:46604A3C-0901-4893-88BE-FE8CEDD344BC (AT) microsoft (DOT) com...
Hi,
I currently use Transform Data Task to load data into a tbl. The
source
data
is a select stmt. I'd like to make the db names used in the select
stmt
dynamic/varaible. I've unsuccessully tried using input params in the
sql
stmt
(the source tab). Also considered using an SP for the select stmt to
create
the source data, but the output is a very large rowset (performance
issues)
and won't be be possible to use the Transform Data Task to move the
data
(have to resort to ActiveX datapump!).

Any suggestions are apprecaited.

I have added simplified code representing my select stmt in the
Transform
Data Task, for ease of illust:

SELECT dw.cus_key, staging.cus_order
FROM [datawarehouse]..[customer] dw
INNER JOIN [staging]..[order] staging)
--I want the 'datawarehouse' & 'staging' db names to be variable (i.e.
set
@
exe time via GVs, INI, etc)

TIA

MA






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.