Friday

Custom RAISERROR in SQL Server 2005 (T-SQL)

how to add custom message %s is place holder for argument:
 exec sp_addmessage @msgnum = 60555, @severity = 16,
@msgtext = 'MSIEX:[[%s]]',
@lang = 'us_english';
go

to see your message in messages table:

SELECT * FROM sys.messages

Assert procedure in TSQL :

ALTER PROC usl_AssertionsThrow
@msg VARCHAR(MAX)
AS
BEGIN
RAISERROR ( 60555, 20, 1,@msg) WITH LOG
END

this setting terminate stored procedure after RAISERROR

SET XACT_ABORT ON




more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...