Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Raiserror and numeric parameters (real, float)
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01226806
Message ID:
01226872
Vues:
13
>>The RAISEERROR supports only integers for %d/%i. You'll have to convert your numeric value to a string and use with %s modificator.
>
>:-) Thanks for confirm me what I was thinking!
>
>So, I have 'updated' my function like this:
>
>
>Declare @Var1 Integer, @Var2 numeric (9,2), @Var2s VarChar(10)
>Set @Var1 = 1
>Set @Var2 = 123.45
>Set @Var2s = Ltrim(Str(@Var2,9,2))
>RaisError('Var1 = %i Var2 = %-s',16,1,@Var1, @Var2s)
>
No need of LTRIM(STR(....)) if you CAST the variable to varchar()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform