RE: How to capture SQL statement messages in DTS log file
- From: petery@xxxxxxxxxxxxxxxxxxxx ("Peter YangMSFT]")
- Date: Tue, 18 Sep 2007 03:25:50 GMT
Hello Ellen,
Actually, when server run the command 'update statistics <tablename>'
successfully, it doesn't return anything.
You could see "Command(s) completed successfully" message in Query Analyzer
but you shall not see this from other applications such as OSQL etc because
the message is actaully generated by QA itself.
You could check "@@error" variable for the success of each command if you
don't get any errors. You can view the text associated with an @@ERROR
error number in sysmessages system table. For example, you could use the
following script to do check the error of update statitics command.
=====
declare @tablename varchar(50)
select @tablename = 'tbl1'
declare @query as varchar(200)
select @query= 'update statistics ' + @tablename
exec (@query)
IF @@ERROR <> 0
BEGIN
PRINT N'An error occurred while updateing statistics of table '+
@tablename;
RETURN 99;
END
ELSE
BEGIN
-- Return 0 to the calling program to indicate success.
PRINT N'update statistics succeeds for table '+ @tablename;
RETURN 0;
END;
If you have any further questions or comments on this issue, please feel
free to let's know. Thank you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Prev by Date: Re: Transfer SQL Server Objects Task not working with Stored Procedures
- Next by Date: Error when running DTS package as job
- Previous by thread: SQLDTS Transfer File Task
- Next by thread: RE: How to capture SQL statement messages in DTS log file
- Index(es):
Relevant Pages
|