18 April,2017 by Tom Collins
Over the last few versions SQL Server has improved greatly on writing sql server error messages . A good example is writing to both SQL Server Error Log and the windows server event viewer.
There are a number of benefits in writing a SQL Server error to the windows event viewer.
To write a message to windows event viewer is impolemented by using the procedure : xp_logevent
An example is :
EXEC xp_logevent 60000, 'A message from MSSQL$TEST', informational
Which would generate an Windows Event Viewer entry in the Application Logs
Error: 60000 Severity: 10 State: 1 A message from MSSQL$TEST
Note: db_owner or sysadmin is required
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |