Groups | Blog | Home
all groups > sql server dts > august 2005 >

sql server dts : DTS and parameters inside the select clause


Scott Lam
8/25/2005 10:52:02 PM
Hi,

I'm trying to create a DTS package using a Transform Data Task using the
following query:
"Select field1, ? from Table1 ". I want to pass a parameter inside my select
query so I can populate the destination with the parameter that I'm passing.

Is it possible to pass a parameter inside a select clause ? Everytime I do,
I get a parse error ?

I created a stored procedure that calls this DTS package thru the DTSRUn
command, I have designed previous DTS and it works if I use the parameters in
the "WHERE" clause.


Thanks,
Scott

Aengus
8/26/2005 7:06:05 AM
Try building sql statement within ActiveX script using something like this:

set pkg = DTSGlobalVariables.parent
' Get DataPump CustomTask
Set stp = pkg.Steps("DTSStep_DTSDataPumpTask_1")
Set tsk = pkg.Tasks(stp.TaskName)
set oDataPump = tsk.CustomTask

' Build new SQL Statement
'sSQLStatement = "SELECT * FROM employee WHERE hire_date > '" &
DTSGlobalVariables("FilterDate").Value & "'"





[quoted text, click to view]
Allan Mitchell
8/27/2005 9:01:20 AM
Have a look at this article


Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)




[quoted text, click to view]

AddThis Social Bookmark Button