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 2005 Forums
 Transact-SQL (2005)
 renaming table

Author  Topic 

doran_doran
Posting Yak Master

179 Posts

Posted - 2009-11-04 : 13:10:12
If I rename a table do I have to redo the relationship or it's automatically done for me?

current table name: tblUnit
preferred name: tblIntelligentUnit

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-11-04 : 13:29:30
Hi

sp_RENAME '[OldTableName]' , '[NewTableName]'



-------------------------
R...
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-04 : 13:39:54
Any query that references tblUnit will have to be changed to now reference tblIntelligentUnit. You can look at SYNONYMS in Books On Line to avoid having to rewrite a bunch of queries.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

doran_doran
Posting Yak Master

179 Posts

Posted - 2009-11-04 : 13:54:35
Thanks Rajdaksha.

Jim: I didnt get this part "You can look at SYNONYMS in Books On Line to avoid having to rewrite a bunch of queries."

I understand the part re-writing the queries. But your solution got me confused.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-04 : 14:01:42
Did you read about SYNONYMS in Books On Line?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -