Home > Archive > MS SQL Server > November 2006 > Re: Query where feild name is reserved









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Query where feild name is reserved
Tibor Karaszi

2006-11-09, 7:14 pm

ANSI SQL compliant:

SELECT "desc" FROM foo


SQL Server specific:

SELECT [desc] FROM foo

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/



<Scamp@nospam.com> wrote in message news:i187l2tkup4aols
7dv9kvbr4gfjd51626t@
4ax.com...
> Using query analyzer, how can I return a column (desc in this case)
> that is also a reserved word?
>
> I'm working with a commercial product so I can't change the name of
> the column.
>
> I've tried things like:
>
> Select desc from foo
> Select 'desc' from foo
> select id,desc from foo
>
> etc...
>
> each one gives me: Error near reserved word 'desc'
>
>
>
> Thanks.
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com