how to rename the table
Answers were Sorted based on User's Feedback
Answer / rajkumar
SP_RENAME 'OLDTABLE NAME', 'NEW TABLE NAME'
eg:
SP_RENAME 'TBL_EMPLOYEE', 'TBL_EMP'
Is This Answer Correct ? | 11 Yes | 3 No |
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 |
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 |
What is the use of “join” in sql server?
What do mean by xml datatype?
What should be the fill factor for indexes created on tables? : sql server database administration
Explain isolation levels that sql server supports?
How to create a user name in a database?
What is the command used to check locks in microsoft sql server?
Explain system scalar functions?
how many triggers you can have on a table? : Sql server database administration
How to run queries with sql server management studio express?
Difference between uniqe index and uniqe constraint?
what is a transaction? : Sql server database administration
Tell me what do you mean by an execution plan? Why is it used? How would you view it?