Reserved Keywords

A

Anatoly

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

Anatoly
 
N

NuTcAsE

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


NuTcAsE
 
A

Anatoly

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
 
N

NuTcAsE

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
 
A

Anatoly

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top