Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Write a code to select distinct records without using the DISTINCT keyword.

0 Answers   Aspiring Minds,


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

0 Answers  


What is The Use Of TIMESTAMP DataType in SQL Server 2005?

6 Answers  


Can you give an example of Stored Procedure?

4 Answers   Wipro,


Give me a SQL Query to find out the second largest company?

0 Answers   Ernst Young,


Explain boyce and codd normal form(bcnf)?

0 Answers  


How to delete duplicate rows in sql server?

0 Answers  


Explain a differential backup?

0 Answers  


What is the difference between the following two sql statements select count(*) from <tablename> select count(col_name) from <tablename>

5 Answers   247Customer,


how to determine the service pack currently installed on sql server? : Sql server database administration

0 Answers  


What are the security related catalog views? : sql server security

0 Answers  


Working with TLogs

0 Answers  


Categories