how can I change a table name? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

how can I change a table name?

Wonder what is the command to change a table name from Staff to Employee? thanks.
That table has FK?
Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
All postings are provided “AS IS” with no warranties for accuracy.
yes.
sp_rename procedure… This example renames the customers table to custs.
EXEC sp_rename ‘customers’, ‘custs’
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

Thanks so much! It worked. It’s my first experience on the site and I really enjoyed it.
Good…<br />Welcome to the SQL community…and enjoy the rid [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]<br /><br />MohammedU.<br />Moderator<br />SQL-Server-Performance.com<br /><br />All postings are provided “AS IS” with no warranties for accuracy.<br />
Just to add on:
After renaming tables, stored procedures and views, flush the procedure cache to ensure all dependent stored procedures and views are recompiled. Welcome to the forum! Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
if you are using sql server 2005, right click the table and select option named rename —————————————-
Contributing Editor, Writer & Forums Moderator
http://www.SQL-Server-Performance.Com Visit my Blog at
http://dineshasanka.spaces.live.com/

thanks. its gud to use.
quote:Originally posted by lokesh546 thanks. its gud to use.
What is good to use? Madhivanan Failing to plan is Planning to fail
]]>