![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#3
| |||
| |||
|
|
You would need to write your own logger like this. "executing a sql file"? If you are using osql then the -o switch might help you. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401281940.a772ff6 (AT) posting (DOT) google.com... I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#4
| |||
| |||
|
|
Allan, My requirement is to produce the same log from dts sql task as would be produced by osql.exe -o. But i don't want to use osql.exe, as i am using a oledb connection. Pls let me know if you have any ideas. Thanks pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote You would need to write your own logger like this. "executing a sql file"? If you are using osql then the -o switch might help you. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401281940.a772ff6 (AT) posting (DOT) google.com... I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#5
| |||
| |||
|
|
Giving something like a running commentary on the execution of the ExecuteSQL task would be quite laborious as this version of DTS does not have event handlers. The workaround would be verbose and would use Global Variables and parameter mappings (2000) For INSERTs Set nocount on declare @cnt int insert HelloLogger select 1 union select 2 select @cnt = @@rowcount select @cnt as 'RowsAffected' UPDATEs set nocount on declare @cnt int update hellologger set col1 = col1 where col1 = 1 set @cnt = @@rowcount select @cnt as 'RowsAffected' If you are going to use Stored procs then you can capture rows affected inside the proc and pass them out as Output parameteres the DataPump task has properties of RowsInError and RowsComplete which are useful. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.orgso. You would need to use Globalvariables and write their values out. "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401291743.402d038f (AT) posting (DOT) google.com... Allan, My requirement is to produce the same log from dts sql task as would be produced by osql.exe -o. But i don't want to use osql.exe, as i am using a oledb connection. Pls let me know if you have any ideas. Thanks pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:<e62hHUj5DHA.2720 (AT) TK2MSFTNGP09 (DOT) phx.gbl>... You would need to write your own logger like this. "executing a sql file"? If you are using osql then the -o switch might help you. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401281940.a772ff6 (AT) posting (DOT) google.com... I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#6
| |||
| |||
|
|
Allan, When i use "execute SQL Task", in case of errors, proper line line no. at which error has occurred is not displayed in the error log. IS it possible to somehow achieve this using "execute SQL task" only. Also Is it possible to configure the retry interval when using DTSStepScriptResult_RetryLater? thanks, pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote Giving something like a running commentary on the execution of the ExecuteSQL task would be quite laborious as this version of DTS does not have event handlers. The workaround would be verbose and would use Global Variables and parameter mappings (2000) For INSERTs Set nocount on declare @cnt int insert HelloLogger select 1 union select 2 select @cnt = @@rowcount select @cnt as 'RowsAffected' UPDATEs set nocount on declare @cnt int update hellologger set col1 = col1 where col1 = 1 set @cnt = @@rowcount select @cnt as 'RowsAffected' If you are going to use Stored procs then you can capture rows affected inside the proc and pass them out as Output parameteres the DataPump task has properties of RowsInError and RowsComplete which are useful. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.orgso. You would need to use Globalvariables and write their values out. "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401291743.402d038f (AT) posting (DOT) google.com... Allan, My requirement is to produce the same log from dts sql task as would be produced by osql.exe -o. But i don't want to use osql.exe, as i am using a oledb connection. Pls let me know if you have any ideas. Thanks pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:<e62hHUj5DHA.2720 (AT) TK2MSFTNGP09 (DOT) phx.gbl>... You would need to write your own logger like this. "executing a sql file"? If you are using osql then the -o switch might help you. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401281940.a772ff6 (AT) posting (DOT) google.com... I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#7
| |||
| |||
|
|
I do not think you can grab "Error at line XX. Incorrect syntax near YY" Can you not set a sleep for the rety interval so SLEEP 10 ? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0402052020.30b09091 (AT) posting (DOT) google.com... Allan, When i use "execute SQL Task", in case of errors, proper line line no. at which error has occurred is not displayed in the error log. IS it possible to somehow achieve this using "execute SQL task" only. Also Is it possible to configure the retry interval when using DTSStepScriptResult_RetryLater? thanks, pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:<eDaaTOw5DHA.2760 (AT) TK2MSFTNGP09 (DOT) phx.gbl>... Giving something like a running commentary on the execution of the ExecuteSQL task would be quite laborious as this version of DTS does not have event handlers. The workaround would be verbose and would use Global Variables and parameter mappings (2000) For INSERTs Set nocount on declare @cnt int insert HelloLogger select 1 union select 2 select @cnt = @@rowcount select @cnt as 'RowsAffected' UPDATEs set nocount on declare @cnt int update hellologger set col1 = col1 where col1 = 1 set @cnt = @@rowcount select @cnt as 'RowsAffected' If you are going to use Stored procs then you can capture rows affected inside the proc and pass them out as Output parameteres the DataPump task has properties of RowsInError and RowsComplete which are useful. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.orgso. You would need to use Globalvariables and write their values out. "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401291743.402d038f (AT) posting (DOT) google.com... Allan, My requirement is to produce the same log from dts sql task as would be produced by osql.exe -o. But i don't want to use osql.exe, as i am using a oledb connection. Pls let me know if you have any ideas. Thanks pradeep "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:<e62hHUj5DHA.2720 (AT) TK2MSFTNGP09 (DOT) phx.gbl>... You would need to write your own logger like this. "executing a sql file"? If you are using osql then the -o switch might help you. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote in message news:2fe85a61.0401281940.a772ff6 (AT) posting (DOT) google.com... I am executing a sql file through dts. Is is possible to get complete sql execution log (i.e. so many rows updated etc.) and not just step failure reason. Please help me with this. Thanks, pradeep |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |