Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Need Help in Event Viewer

Author  Topic 

mahender
Starting Member

12 Posts

Posted - 2011-12-28 : 11:00:12
Could anyone help me outhow to map sql server 2008 r2 with windows Event viewer (windwos 7)
the error message will come through sql agent jobs

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-12-28 : 11:58:58
Would xp_logevent be an answer to your needs? BOL has the specifics. If this doesn't help, let us know and clarify what's lacking.

=======================================
Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof. -John Kenneth Galbraith
Go to Top of Page

mahender
Starting Member

12 Posts

Posted - 2011-12-28 : 12:18:13

This wil only write in the sql log event , could you help me out with how to configure with the windows event viewer . how to map the both to get the log


quote:
Originally posted by Bustaz Kool

Would xp_logevent be an answer to your needs? BOL has the specifics. If this doesn't help, let us know and clarify what's lacking.

=======================================
Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof. -John Kenneth Galbraith

Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-12-28 : 15:00:10
Per BOL: "Logs a user-defined message in the SQL Server log file and in the Windows Event Viewer."
I have not used this procedure but it does seem to adderess your requirements. Let me know.

=================================================
Men shout to avoid listening to one another. -Miguel de Unamuno
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-12-28 : 18:04:08
I issued a plain test message using this extended stored procedure and was able to see the e3vent in both SQL Logs and the Windows Event Viewer (Applications). The BOL text seems a bit ambiguous to me; they seem to say that RAISERROR would be a better solution. I'd try each approach and see which one better meets your needs.

=================================================
Men shout to avoid listening to one another. -Miguel de Unamuno
Go to Top of Page
   

- Advertisement -