RAISERROR WITH LOG and performance

  • As RAISERROR WITH LOG will write into EventLog it will negatively affect performance of the existing code for sure.

    BUT!

    The real question is: Will the negative effect of its use be significant enough in YOUR case! Try and you will see.

    1. Rolling back of transaction will not roll back logged message, as WITH LOG tells to SQL to log the message into Windows EventLog.

    2. It is not everyone can specify this option. Check the required security level for using it (try msdn it does help sometimes):

    http://msdn.microsoft.com/en-us/library/ms178592.aspx

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Thanks for the input. I didn't think about the security permissions either...

  • You can get around the security issue by using sp_altermessage, but that means *every* occurence of the message will be logged.

    You might be able to get around that by altering the msg prior to the loads, running the loads, then altering the msg back .

    Scott Pletcher, SQL Server MVP 2008-2010

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply