开发者

SQL Server 2008 error message from stored procedure

I am using SQL Server 2008 Enterprise. When we met with such error message from stored procedure,

Message 1205, Level 13, State 52, the process Pr_FooV2, Line 9 Services (Process ID 111) and another process is deadlock in the lock | communication buffer resources, and has been chosen as the deadlock victim.开发者_StackOverflow Rerun the transaction.

I am wondering whether such messages are stored in log files? I searched log folder of my SQL Server 2008 installation root (in my environment, it is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log), but can not find such files.

thanks in advance,

George


In SQL 2008 it looks like you can via sp_altermessage.

http://sqlblog.com/blogs/tibor_karaszi/archive/2009/05/14/sp-altermessage-is-back-in-business.aspx

Edit: Example to perform batch operation for all messages of severity 14

DECLARE @severity INT
SET @severity = 14

declare @dynsql nvarchar(max)

set @dynsql = ''

SELECT   
    @dynsql = @dynsql + 'EXEC sp_altermessage
     @message_id = ' + CAST(message_id AS varchar(10)) + '
    ,@parameter = ''WITH_LOG''
    ,@parameter_value = ''true'' ;
'
FROM
(
SELECT DISTINCT message_id 
FROM         sys.messages
WHERE  is_event_logged=0 AND severity=@severity
) D

EXEC sp_executesql @dynsql
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜