Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flushing RaiseError() messages in script
Message
De
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:
01617365
Vues:
24
After looking more at this, I remembered there was a reason for this.

Basically, lets take this script:
DECLARE @Command nvarchar(4000)

SET @Command = N'DROP INDEX [NoClient] ON [Invoice]'
PRINT @Command
This would work to replace it with this:
DECLARE @Command nvarchar(4000)

SET @Command = N'DROP INDEX [NoClient] ON [Invoice]'
Raiserror(@Command,0,1) With Nowait
But, I need this:
DECLARE @Command nvarchar(4000)

SET @Command = N'DROP INDEX [NoClient] ON [Invoice]'
Raiserror(@Command+'...',0,1) With Nowait
And, this does not work. It seems Raiserror() has no support for concatenation with such syntax.

Also, more complex lines like this:
PRINT '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)+'...'
Will not work when being converted to this:
Raiserror('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)+'...',0,1) With Nowait 
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform