Reserved Keywords

  • Thread starter Thread starter Anatoly
  • Start date Start date
A

Anatoly

How can I SELECT a column data whose name is using one of the reserved
keywords?
For example "Authorization".

Anatoly
 
Put the word in square brackets: [Authorization]
SELECT [Authorization] FROM ABC WHERE...


NuTcAsE
 
I'm using a VS Designer to create a Typed Dataset.
So, when I try to include "[ ]" around columns that use reserved keywords,
the Designer's wizard removes the brackets automatically no matter what I
do.

Anatoly
 
Are your creating a SqlDataAdapter in your winform designer and then
right clicking and generating a data set from that data adapter? If yes
and the Select SQL in you adapter looks something like this:

SELECT FirstName, LastName, [Authorization] FROM ABC

The the generated data set will contain the following columns
FirstName, LastName, Authorization.
Dont worry about the [] being removed in the data set schema as when
you run the SQL statement the columns returned are:

FirstName, LastName, Authorization. the '[]' is to tell the sql query
parser to select a column with the exact name, and not a reserved
keyword.
If your doing something else, please explain the steps.

NuTcAsE
 
That's exactly what I'm doing.
But I'm running into issue of how many fields I can specify individually.
See another my thread subject: "Reserved Keywords" FROM: "Anatoly". You
will see the problem I'm running into.

Thanks,
Anatoly
 
Back
Top