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)
 Foreign Keys

Author  Topic 

kumarich1
Yak Posting Veteran

99 Posts

Posted - 2007-11-30 : 09:27:19
I am trying to rename foreign keys in database they are about 300 ,since naming convention was not good when they were initially created.I have created a script using sp_rename .Please advise if it is safe or not to do this.

Thanks

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-11-30 : 10:08:26
Rename? Why?

e4 d5 xd5 Nf6
Go to Top of Page

evilDBA
Posting Yak Master

155 Posts

Posted - 2007-11-30 : 11:51:12
blindman, Usually it is doen when you need to support multiple databases.
When yiu write an upgrade script, you want to reference FK by name, but oops, contraint names contains some unique digits inside the name and are different in different databases
Go to Top of Page

kumarich1
Yak Posting Veteran

99 Posts

Posted - 2007-11-30 : 11:51:50
Initially when they were created they were not created with proper names.Is it safe to rename foreign key constraints?????
Tx
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-11-30 : 14:17:01
Should be. I can't think of why you would reference the constraint by name in any normal code.

e4 d5 xd5 Nf6
Go to Top of Page

kumarich1
Yak Posting Veteran

99 Posts

Posted - 2007-11-30 : 14:27:47
Even I think it should be ok, because we don't reference FK name in any code.

TX
Go to Top of Page
   

- Advertisement -