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 Administration (2000)
 Reserved Keyword 'Function'

Author  Topic 

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2005-01-06 : 14:25:02
All,
I have small question. I am planning on moving a 6.5 database to 2000(Which is another box). I have column name as 'Function' in one of the talbes. Its a SQL Server Reserve Keyword and i am not sure if SQL 2000 whould accept it. Can any one has any ideas how i can Create table with 'Fuction' as column name. I cannot change Column name either, because there are numerous applications are accessing this table.

Thanks,
Rick

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 14:29:40
[code]
create table blah ([function] int)
insert into blah
select 1 union all
select 2 union all
select 3 union all
select 4

select * from blah

drop table blah
[/code]

Go with the flow & have fun! Else fight the flow
Go to Top of Page

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2005-01-06 : 14:58:31
Thanks Spirit

Every time quering this table i need to say

Select -,-,-,[function] from blah?.


Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 15:00:43
unfortunatly yes...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2005-01-06 : 15:09:07
Spirit Thanks somuch!!!
If we do not want to use [Function] in Query.
The only option is to change Column name...Right?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 15:11:11
yes.
but changing Function to [Function] shouldn't be a problem. Find -> replace does wonders.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2005-01-06 : 15:14:30
But what my problem is, many apps are using these tables. I wonder how apps would handle this column?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 15:20:04
you'd get "Incorrect syntax near the keyword 'function'." error message everytime
you have
select ..., function, ...
from ...


Go with the flow & have fun! Else fight the flow
Go to Top of Page

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2005-01-06 : 15:22:22
Thanks Spirit
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-06 : 15:26:03
no problem. hope you work it out...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -