![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello. I have Execute SQL Task with SELECT * FROM ORDERS WHERE OrderID=10248 and I created two variables as f=10248 (int) and r=10249(int) Then I wrote on Active Script Task MsgBox "The order ID is " & DTSGlobalVariables("f").value Main = DTSTaskExecResult_Success Now I have couple questions How do I execute SELECT statement within Execute SQL Task without putting the OrderID=10248 ( I thought we can put '?' but still it does not work) ? Even though when I execute my package with orderid= 10248 then the r variable also get 10248 value , why? |
#3
| |||
| |||
|
|
If you are using SQL Server 2000 you can use ? When you execute a package externally and change a Global Variable it will still be the same value as at runtime when you open it back up again not the value you used. The value the package uses though will be what you passed in. Global Variables and SQL statements in DTS (http://www.sqldts.com/default.aspx?205) -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:OmPZifC1DHA.2160 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hello. I have Execute SQL Task with SELECT * FROM ORDERS WHERE OrderID=10248 and I created two variables as f=10248 (int) and r=10249(int) Then I wrote on Active Script Task MsgBox "The order ID is " & DTSGlobalVariables("f").value Main = DTSTaskExecResult_Success Now I have couple questions How do I execute SELECT statement within Execute SQL Task without putting the OrderID=10248 ( I thought we can put '?' but still it does not work) ? Even though when I execute my package with orderid= 10248 then the r variable also get 10248 value , why? |
#4
| |||
| |||
|
|
Allan Thanks for your answer. Yes I am using SQL Server 2000(SP3) I am not executing package externally but only within EM . When I try SELECT * FROM ORDERS WHERE OrderID=? then I 've got the error "No value given for one or more required parameters" At your wonderful site written that I can alter Execute SQL Task but It looks like Active Script Task syntax and Do I need to install GVCustomTask ? Can you give me an example ? If you have a time I would send you DTS file. "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:#BjOdqC1DHA.3496 (AT) TK2MSFTNGP11 (DOT) phx.gbl... If you are using SQL Server 2000 you can use ? When you execute a package externally and change a Global Variable it will still be the same value as at runtime when you open it back up again not the value you used. The value the package uses though will be what you passed in. Global Variables and SQL statements in DTS (http://www.sqldts.com/default.aspx?205) -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:OmPZifC1DHA.2160 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hello. I have Execute SQL Task with SELECT * FROM ORDERS WHERE OrderID=10248 and I created two variables as f=10248 (int) and r=10249(int) Then I wrote on Active Script Task MsgBox "The order ID is " & DTSGlobalVariables("f").value Main = DTSTaskExecResult_Success Now I have couple questions How do I execute SELECT statement within Execute SQL Task without putting the OrderID=10248 ( I thought we can put '?' but still it does not work) ? Even though when I execute my package with orderid= 10248 then the r variable also get 10248 value , why? |
#5
| |||
| |||
|
|
Let's take Pubs:authors I have a Global Variable of String gv_Authors_id My ExecuteSQL string is select au_lname from authors where au_id = ? I hit parameters I assign my Global Variable to an Input parameter What is the connection data source for the ExecuteSQL task ? -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%23AMicrosoftM2C1DHA.1736 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Allan Thanks for your answer. Yes I am using SQL Server 2000(SP3) I am not executing package externally but only within EM . When I try SELECT * FROM ORDERS WHERE OrderID=? then I 've got the error "No value given for one or more required parameters" At your wonderful site written that I can alter Execute SQL Task but It looks like Active Script Task syntax and Do I need to install GVCustomTask ? Can you give me an example ? If you have a time I would send you DTS file. "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:#BjOdqC1DHA.3496 (AT) TK2MSFTNGP11 (DOT) phx.gbl... If you are using SQL Server 2000 you can use ? When you execute a package externally and change a Global Variable it will still be the same value as at runtime when you open it back up again not the value you used. The value the package uses though will be what you passed in. Global Variables and SQL statements in DTS (http://www.sqldts.com/default.aspx?205) -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:OmPZifC1DHA.2160 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hello. I have Execute SQL Task with SELECT * FROM ORDERS WHERE OrderID=10248 and I created two variables as f=10248 (int) and r=10249(int) Then I wrote on Active Script Task MsgBox "The order ID is " & DTSGlobalVariables("f").value Main = DTSTaskExecResult_Success Now I have couple questions How do I execute SELECT statement within Execute SQL Task without putting the OrderID=10248 ( I thought we can put '?' but still it does not work) ? Even though when I execute my package with orderid= 10248 then the r variable also get 10248 value , why? |
![]() |
| Thread Tools | |
| Display Modes | |
| |