Posted By

emregulcan on 02/04/11


sql StoredProcedure raiserror

Versions (?)

sql Raiserror with parameters

 / Published in: SQL


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"

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

Report this snippet  

You need to login to post a comment.