If you would like to query the ERRORLOG with T-SQL you have the undocumented procedure…
When you use Database mail in SQL server you receive the following error message:
Error: 14667, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped
This is a confirmed bug since SQL Server 2005 and should have been solved in later versions, but it’s not. The bug is still there!
The errror occurs because the sp_readrequest stored procedure uses an incorrect parameter.
The solution according to Microsoft (http://support.microsoft.com/kb/931175) is to change the inccorect code in sp_readrequest.
- Start SQL Server Management Studio, and then connect to the instance of SQL Server 2005.
- In Object Explorer, locate and then right-click the following object:
DatabasesSystem DatabasesmsdbProgrammabilityStored Proceduresdbo.sp_readrequest
- Click Modify.
- Locate the following line of code.
SET @localmessage = FORMATMESSAGE(14667, convert(NVARCHAR(50), @mailitem_id))
- Replace the existing line of code by using the following line of code.
SET @localmessage = FORMATMESSAGE(14667, @mailitem_id)
- On the Query menu, click Execute.
It looks like a simple fix.,but it isn’t it fixed in any service pack so far. Please vote for a fix at :https://connect.microsoft.com/SQLServer/feedback/details/625096/syntax-error-in-sp-readrequest-prevents-proper-error-and-can-halt-db-mail
/Håkan Winther
COO