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:
01226844
Vues:
14
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 your attention.
>
>I can't just convert to integer, because I will lost decimals values. So, I just can't find any parameter to replace %i. Take a look a workaround:
>
>
>Declare @Var1 Integer, @Var2 Numeric (9,3), @Var2i int, @Var2d int
>Set @Var1 = 1
>Set @Var2 = 123.45
>Set @Var2i = Cast(@Var2 As integer)
>Set @Var2d = (@Var2 - cast(@Var2 as integer) )*100
>RaisError('Var1 = %i Var2 = %i,%i',16,1,@Var1, @Var2i, @Var2d)
>
>
>But I think it is possible to use numerics as raiserror's parameters. I just don't know how! :-)
>
>Thanks again.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform