July 24, 2005 at 7:22 pm
Hi,
i used an execute sql task object in my dts. i read something about dynamic properties and i incorporated it in my dts so that if i need to transfer it to another server, all i need to do is edit the ini file and everything will work fine.
i just want to know how can i use a global variable in my execute sql task object.
thanks
ann
July 25, 2005 at 3:08 am
Hi,
In execute sql task either you need to make a query or execute stored procedures. In both cases you can use global variables for parameters. like in a sql query you can use something like
SELECT column_name
FROM table_name
WHERE some_column_name = ?
Then click on the parameters tab and click on input global variables and the select the one you want to use.If you have many parameters in your query then you need to add them in the order they occur in your query(Likewise you can use global variables to store the result of your query as well).
Hope this helps
Urvashi
July 25, 2005 at 3:10 am
Hi!
The fact of using a Global variable in a SQL Task is nothing to be with using Dynamic Properties Task. It's completely independente.
To use a Global Variable in a SQL Task, you just need to put the "?" caracter in the positions (inside SQL statement) you whant to substitute by the global variables. Then press the parameters button, and associate the correct Global Variable to each "?".
Vitor
July 25, 2005 at 8:23 am
I'm using this today also. This worked, so thanks!
July 25, 2005 at 5:27 pm
my sql statement is below and after typing them and pressing on the parameters button, i am getting an error: syntax error or acces violation. then i can't get access to the parameters screen.
exec master.dbo.xp_sendmail 'email address',
'Please find attached excel file containing the current movements for AWA',
'',
?,
'',
'',
'subject line'
any ideas?
ann
July 25, 2005 at 8:25 pm
got it. answer is shown in the link below:
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply