Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flushing RaiseError() messages in script
Message
 
À
29/03/2015 18:53:52
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01617332
Message ID:
01617376
Vues:
27
This message has been marked as a message which has helped to the initial question of the thread.
>And, this does not work. It seems Raiserror() has no support for concatenation with such syntax.
>

You have to assign your messages to a variable first, then display that variable instead.

Ex.
DECLARE @msg VARCHAR(200);
SET @msg = 'Processing Report at ' + CONVERT(varchar, DATEPART(hour, GETDATE())) + ': '+ RIGHT(REPLICATE('0', 2) 
          + CONVERT(varchar, DATEPART(minute, GETDATE())), 2) + ': '+ RIGHT(REPLICATE('0', 2) 
          + CONVERT(varchar, DATEPART(second, GETDATE())),2)+'...';
RAISEERROR(@msg + '...', 0, 1) WITH NOWAIT;
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform