Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    BA, Argentina
    Posts
    39

    Unhappy Unanswered: Error Log: Does somebody knows how it works?!

    Hi. I'm debugging our application, and I need to see the Sql Server 2000 error log files. The problem is that the Sql Server Engine does not log every error that occurs.
    For example, when I run a query "Select * from kkk", it gives an error saying "Invalid object name 'kkk'", but the error is only returned to the client. Its not logged in the error log files. I think, that this happens because that error has a low level (16), and the log is only for high-level errors.
    Is there a way to configure which errors are logged in the error log, or to make all errors get logged??
    Thanks!
    Last edited by jigarzon; 10-05-04 at 10:54.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Sure you can. You have to consider what messages you REALLY want to see in both SQL Server errorlog and Application event log. Here's a sample that would do a mass conversion of existing non-logged messages:

    Code:
    declare @id int, @severity int
    set @severity = 16
    select @id = min(error) from master.dbo.sysmessages
       where severity = @severity and (dlevel & 128) = 0
    while @id is not null begin
       EXEC sp_altermessage @id, with_log, true
       select @id = min(error) from master.dbo.sysmessages
    	  where severity = @severity and error > @id and (dlevel & 128) = 0
    end
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Oct 2003
    Location
    BA, Argentina
    Posts
    39
    exactly what i need!! I'll try it now.
    Thanks for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •