Hi,Thanks for your answers!How about the trapping of the error message (@@error trap only the error code)?I have seen in that post (http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=26324) that there is a solution:DECLARE @Err INT-- Your SQL HereSET @Err = @@ErrorIf @Err<>0beginselect @MsgDate=getdate()select @strMsg=substring(description, 1, 150) from master.dbo.sysmessages where error=@Errinsert into IntLog values (@RunGroup, 'GL', @MsgDate, @strMsg)end
The problem is that the message can be, for example:"Line %d: Incorrect syntax near '%.*ls'."How can I get the true message (with %d et %ls well filled).Best regardsNicolas