Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Raiserror
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
01114790
Message ID:
01114796
Views:
13
This message has been marked as the solution to the initial question of the thread.
DECLARE @CustomerId nvarchar(10) 
SET @CustomerId = 'Test'
RAISERROR ('CustomerId ''%s'' does not exist in Customer table. Error: %o.', 16, 1, @CustomerId, @@ERROR)
>The following raiserror works:
>
>RAISERROR ('CustomerId does not exist in Customer table. Error: %o.', 16, 1, @@ERROR)
>
>
>Now I want to also print the acctual CustomerId which happends to be stored in the variable @CustomerId (type is nvarchar(10)). How can I get the SP to raise an error with the following message (if CustomerId=einar):
>
>CustomerId einar does not exist in Customer table. Error: 0.
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform