Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where clause with integer
Message
 
 
À
19/10/2011 11:00:55
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01526883
Message ID:
01526884
Vues:
83
This message has been marked as the solution to the initial question of the thread.
>I have an integer field Member.Numero and do this:
>
>
>SELECT * from Member WHERE Numero=1
>SELECT * from Member WHERE Numero='1'
>
>
>Why both SQL work? Isn't it suppose to give an error on the second one?

It implicity converts '1' to the higher precedence which is integer.

Take a look at this
Data Type Precedence (Transact-SQL)

Integer has higher precedence than char.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform