how to rename the table

Answers were Sorted based on User's Feedback



how to rename the table..

Answer / rajkumar

SP_RENAME 'OLDTABLE NAME', 'NEW TABLE NAME'
eg:
SP_RENAME 'TBL_EMPLOYEE', 'TBL_EMP'

Is This Answer Correct ?    11 Yes 3 No

how to rename the table..

Answer / vishal

Rename a table using sp_rename

sp_rename <Old Table Name>, <New Column Name>


Rename a column using sp_rename
here as third argument we have to provide column. default
third argument for sp_rename is table.


sp_rename <table name>.<old Column Name>, <New Column Name>,
'column'

Is This Answer Correct ?    2 Yes 0 No

how to rename the table..

Answer / mohan

Rename a table
This example renames the customers table to custs.

EXEC sp_rename 'customers', 'custs'

B. Rename a column
This example renames the contact title column in the
customers table to title.

EXEC sp_rename 'customers.contacttitle', 'title', 'COLUMN'

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL Server Interview Questions

What is the use of “join” in sql server?

0 Answers  


What do mean by xml datatype?

0 Answers  


What should be the fill factor for indexes created on tables? : sql server database administration

0 Answers  


Explain isolation levels that sql server supports?

0 Answers  


How to create a user name in a database?

0 Answers  






What is the command used to check locks in microsoft sql server?

0 Answers  


Explain system scalar functions?

0 Answers  


how many triggers you can have on a table? : Sql server database administration

0 Answers  


How to run queries with sql server management studio express?

0 Answers  


Difference between uniqe index and uniqe constraint?

0 Answers  


what is a transaction? : Sql server database administration

0 Answers  


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

0 Answers  


Categories