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:
01226904
Vues:
15
Sorry, my mistake! :-( Thanks!!!


>CAST will return 3 decimals only if your VAR is defined as Numeric(9,3), if it is defined as Numeric(9,2) it will return 2 decimals:
>
>declare @var1 as Numeric(9,3), @var2 as Numeric(9,2)
>SET @var1 = 1.12
>SET @var2 = 1.12
>SELECT CAST(@var1 as varchar(200)),CAST(@var2 as varchar(200))
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform