Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dealing with reserved words
Message
 
To
07/03/2008 00:49:30
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01299625
Message ID:
01299641
Views:
9
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform