Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql key words

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-09 : 07:29:43
piyush writes "suppose i created one table "Temp1"
and there is one column named "Group"
ok

when i open the table structure of "Temp1" in Enterprise manager
it ll show column name as "[Group]"

but

when i go to query analyser i m typing

"select * from syscolumns where id in
(select id from sysobjects where name = 'Temp1')"

then it ill show as record "Group"

Keyword "Group" is sql keyword we cannot use directly

right now i m making one prog for structure update
i m using above query to match the prev table structure & curr table structure

then how can i know that the keyword "Group" is Sql keyword
is there any table where all keys are defind"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-09-09 : 07:32:49
Since Group is a reserved SQL Server keyword, Enterprise Manager adds the square brackets around it as an indicator. SQL Server Books Online has an entry under "reserved keywords" in its index that lists all the reserved words, and you should try to avoid using them as column or object names.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-09 : 07:34:38
When you type the words in Query Analyser keywords will have blue, purple and green color
Better to avoid using those names as object names

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -