RE: How to capture SQL statement messages in DTS log file



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.

.



Relevant Pages

  • Re: Latest on Word 2003 Crashing Display.
    ... Internet Support site of the vendors. ... :> also tried the support forums in Microsoft without success. ... :> 1) Reformatting both Drives and reinstalling everything, ... font will stop typing and the blue font will start. ...
    (microsoft.public.word.application.errors)
  • Re: Sort it once and for all
    ... No one's argument will change that, statistics or no ... two things most football fanatics give freely. ... teams with recent success. ... I'm not talking about support on a local level. ...
    (uk.sport.football.clubs.liverpool)
  • Re: Web page Error - "The system cannot find the file specified" Error
    ... We tried running Filemon but never got any error status message (FILE ... SUCCESS" status, there absolutely no "500" status error in the IIS logs. ... > Microsoft Online Partner Support ...
    (microsoft.public.inetserver.iis)
  • Palm internet without PhoneLink?
    ... customer and used their GPRS service with much success. ... I'd like to return to the days when I could connect my Palm ... connection or is it just necessary and requires additional support on ...
    (comp.sys.palmtops.pilot)
  • [SLE] Re: postfix bug: SuSEconfig.postfix runs arbitrary command, and/or fails but returns success c
    ... >> configuration and then incorrectly report that it has done so ... A system utility relying upon the command search path of its ... And the fact that it returns 0, which indicates success, after ...
    (SuSE)