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:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...