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 difference between having clause and where clause in sql server?
How will you fine tune a stored procedure or what are the steps that should be taken to fine tune or optimize a stored procedure?
Describe in brief system database.
What is dml command?
Diff. b/w Full Outer Join And Cross Join?
What happens if the update subquery returns no rows in ms sql server?
How to change the system date and time from SQL Plus Terminal ?
What is the difference between indexing and hashing?
what is sql injection in sql server?
Write a SQL command to insert and update only a particular field?
how to write the query to select the rows are in the order of either 1,3,5,7... or 2,4,6,8,...
7 Answers ADP, Satyam, Tech Mahindra,
How to tune a stored procedure?