Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dealing with reserved words
Message
 
À
07/03/2008 00:49:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01299625
Message ID:
01299641
Vues:
10
>In my framework, based on the backend, the SQL are being adjusted in regards to the reserved words. Until now, I never had to deal with that in the client application, as at that level, all the code is ANSI SQL compliant. But, exceptionally, at one place in the client application, I have a SQL that is based on a table named Table. So, as I wanted to always have generic code at the client application level, I can see two approaches. Where needed, I can call a method which will help me to generate that SQL based on reserved words. The second one would be to know if there would be a setting in SQL Server that would allow me to run a SQL like this without any problem:
>
>
>SELECT Table.Numero FROM Table
>
>
>Any comment?

You can always use square brackets around table names and fields. That way you don't have to be careful if the field name or table name uses reserved word:
SELECT [Table].[Numero] FROM Table
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