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

Why Do you want to work in this company?

4 Answers   HCL,


1 01 101 01010

0 Answers  


What is used to replicate sessions between instances in coldfusion clusters?

0 Answers   HCL,


How to get last system shutdown time in Sql server when restarted system?

1 Answers  


Do you know the different ddl commands in sql?

0 Answers  






How to make a column nullable?

0 Answers  


How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

0 Answers  


What are orphan records?

0 Answers  


What is the difference between writing data to mirrored drives versus raid5 drives

0 Answers  


Is candidate a key?

0 Answers  


What is a transact-sql statement?

0 Answers  


wat is mean by trigger?.......normally wat use......when trigger used in sql........... plz cleary say with example.......

2 Answers   TCS, Wipro,


Categories