Return to Snippet

Revision: 40619
at February 4, 2011 11:48 by emregulcan

Initial Code
DECLARE @raiseErrorCode nvarchar(50)
SET @raiseErrorCode = CONVERT(nvarchar(50), YOUR UNIQUEIDENTIFIER KEY)
RAISERROR('%s INVALID ID. There is no record in table',16,1, @raiseErrorCode)

Initial URL

Initial Description
You can see details on , but I try to explain how you throw error with "uniqueidentifier" type parameters.

I convert uniqueidentifier to string (nvarchar(50)) and set a variable.
"%s" is equal to "string"

Initial Title
sql Raiserror with parameters

Initial Tags

Initial Language