Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to deal with OPTION column
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01343791
Message ID:
01343794
Vues:
13
>Hello,
>
>I have a column/field named "OPTION". I have noticed that in SQL Server this name is enclosed in square brackets "[]". Therefore I presume that this name is reserved. Therefore the column named "OPTION" is ok.
>
>But the problem I have is when I created a SQL Command and pass it to the SQL Server via SPT, I get error "near keyword [option]".
>
>How can I include name OPTION in the SQL Select so that SQL Server will allow it? Here is a segment of the SQL Select I have:
>
>
>... ISNULL( mytable.option, CAST('' as CHAR(8))) as OPTION
>
>
>Thank you in advance for any help.

You can try

ISNULL( mytable.option, CAST('' as CHAR(8))) as "OPTION" or try [] if the first option would not work.
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