Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Raiserror
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
01114790
Message ID:
01114796
Vues:
12
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform