![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How do I get the result string from a "Execute SQL Task". Say I have a SQL statement "DELETE FROM TBL_X" I run my DTS package and 50 records are deleted. Or it could be an UPDATE and 50 records changed. Query Analyzer reports this in the message tab. I would like to get this "Message" from the task. I have a ActiveX script Task I use to collect other pieces of information, but not this. -- G. Stark MIS Electro Rent Corp. |
#3
| |||
| |||
|
|
In an ExecuteSQL task here is what I did to get the amount of rows affected by a DELETE statement SET NOCOUNT ON delete from X select @@RowCount as A I then map A to a global variable in my package and do with it as I please Allan "G Stark" <NoSpam (AT) nospam (DOT) com> wrote How do I get the result string from a "Execute SQL Task". Say I have a SQL statement "DELETE FROM TBL_X" I run my DTS package and 50 records are deleted. Or it could be an UPDATE and 50 records changed. Query Analyzer reports this in the message tab. I would like to get this "Message" from the task. I have a ActiveX script Task I use to collect other pieces of information, but not this. -- G. Stark MIS Electro Rent Corp. |
#4
| |||
| |||
|
|
Not getting results. I added gvA to the packages global variable list. Added SET NOCOUNT ON, and SELECT @@RowCount as gvA to the Execute SQL Task In a ActiveX Script I use gvA = DTSGlobalVariables("gvA").Value and can see the gvA is not being effected by Execute SQL Task Would you expand on what you meant by "map" A to a global variable G. Stark "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:ub2oPe5EFHA.2452 (AT) TK2MSFTNGP09 (DOT) phx.gbl... In an ExecuteSQL task here is what I did to get the amount of rows affected by a DELETE statement SET NOCOUNT ON delete from X select @@RowCount as A I then map A to a global variable in my package and do with it as I please Allan "G Stark" <NoSpam (AT) nospam (DOT) com> wrote How do I get the result string from a "Execute SQL Task". Say I have a SQL statement "DELETE FROM TBL_X" I run my DTS package and 50 records are deleted. Or it could be an UPDATE and 50 records changed. Query Analyzer reports this in the message tab. I would like to get this "Message" from the task. I have a ActiveX script Task I use to collect other pieces of information, but not this. -- G. Stark MIS Electro Rent Corp. |
#5
| |||
| |||
|
|
OK Type the statement I had into an ExecuteSQL window. Hit the Parameters button This is an output parameter | Row Value If you do not already have a Global Variable defined then create one here (Bottom Right) Make sure after you do this that it appears alongside your expression (gvA) When you press run this will through the value in gvA into the Global Variable Add An Active Script task after the ExecuteSQL task and join them using an On Success precedence constraint In the text of the Task enter MsgBox DTSGlobalVariables("gvA").Value Let me know if that helps Allan "G Stark" <NoSpam (AT) nospam (DOT) com> wrote Not getting results. I added gvA to the packages global variable list. Added SET NOCOUNT ON, and SELECT @@RowCount as gvA to the Execute SQL Task In a ActiveX Script I use gvA = DTSGlobalVariables("gvA").Value and can see the gvA is not being effected by Execute SQL Task Would you expand on what you meant by "map" A to a global variable G. Stark "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:ub2oPe5EFHA.2452 (AT) TK2MSFTNGP09 (DOT) phx.gbl... In an ExecuteSQL task here is what I did to get the amount of rows affected by a DELETE statement SET NOCOUNT ON delete from X select @@RowCount as A I then map A to a global variable in my package and do with it as I please Allan "G Stark" <NoSpam (AT) nospam (DOT) com> wrote How do I get the result string from a "Execute SQL Task". Say I have a SQL statement "DELETE FROM TBL_X" I run my DTS package and 50 records are deleted. Or it could be an UPDATE and 50 records changed. Query Analyzer reports this in the message tab. I would like to get this "Message" from the task. I have a ActiveX script Task I use to collect other pieces of information, but not this. -- G. Stark MIS Electro Rent Corp. |
#6
| |||
| |||
|
|
In an ExecuteSQL task here is what I did to get the amount of rows affected by a DELETE statement SET NOCOUNT ON delete from X select @@RowCount as A I then map A to a global variable in my package and do with it as I please Allan "G Stark" <NoSpam (AT) nospam (DOT) com> wrote How do I get the result string from a "Execute SQL Task". Say I have a SQL statement "DELETE FROM TBL_X" I run my DTS package and 50 records are deleted. Or it could be an UPDATE and 50 records changed. Query Analyzer reports this in the message tab. I would like to get this "Message" from the task. I have a ActiveX script Task I use to collect other pieces of information, but not this. -- G. Stark MIS Electro Rent Corp. |
![]() |
| Thread Tools | |
| Display Modes | |
| |