ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How can i change the column name.
 Question Submitted By :: Bhaskar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can i change the column name.
Answer
# 1
sp_rename 'tablename.oldcolumnname','newcolumnname'
 
Is This Answer Correct ?    11 Yes 1 No
Durgaprasad
 
  Re: How can i change the column name.
Answer
# 2
ALTER TABLE table_name
 RENAME COLUMN old_name to new_name;
 
Is This Answer Correct ?    5 Yes 7 No
Ramesh5782
[Urvi Software Technologies Pvt.Ltd]
 
 
 
  Re: How can i change the column name.
Answer
# 3
hi all

sp_rename 'tablename.oldcolumnname','newcolumnname','column'
 
Is This Answer Correct ?    6 Yes 0 No
Kinthada Cnu
 
  Re: How can i change the column name.
Answer
# 4
hi frnds, tell me one thing what is the difference b/w AS 
keyword & sp_rename,AS is also used for reanme operation na.
 
Is This Answer Correct ?    2 Yes 0 No
Sonia
 
  Re: How can i change the column name.
Answer
# 5
ALTER TABLE table_name
 RENAME COLUMN old_name to new_name;

 
Is This Answer Correct ?    2 Yes 4 No
Kshirsagar Sambhaji
 
  Re: How can i change the column name.
Answer
# 6
This example renames the contact title column in the 
customers table to title.

EXEC sp_rename 'customers.[contact 
title]', 'title', 'COLUMN'
 
Is This Answer Correct ?    2 Yes 0 No
Y.narendra Kumar
 
  Re: How can i change the column name.
Answer
# 7
Sonia, clear your doubt here.

AS keyword is used for aliasing some existing column name 
for our convenience.But the column name doesn't change @ 
database.

But incase of renaming a column the change is reflected @ 
database n it's usually done if we wish changing property 
of a particular column.

sp_rename 'tablename.oldcolumnname','newcolumnname'->This 
actually works out for Sql 2000.ALTER TABLE key doesn't 
help.
 
Is This Answer Correct ?    2 Yes 0 No
Harsh V M
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is a Linked Server?  1
Suppose in a situation if two list boxes are there and if you select multiple options based on that the options related to those selected items should display in second list box. Again if we select multiple items in second listbox then the related to those selected items should display . In this scenario how will you design database,tables? HP1
what is the main difference between after trigger and instead trigger.  1
what is difference between primary key and Unique  8
what operator performs pattern matching?  1
What is Query Execution Plan? How does it help optimize or tune a database driven application? Accenture2
What is database normalization? Digicel5
write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?  7
What is the purpose of UPDATE STATISTICS?  1
how to write the query to select the rows are in the order of either 1,3,5,7... or 2,4,6,8,... ADP5
How do I compare two values when one value(data type) is char and the other is an integer?  3
How will u find the query which is running in some other machine IBM2
Explain Trigger with an example?  1
What is normalization and its forms? Challenger-Financial3
1.what is the purpose of using alias name in sql server? with certain example? 2.what is cursor?will u plz explain me in detail with certain example?  3
Whether the updations made to the views reflect the original records in the table NIIT5
wat is the main diff between sql server 2000and sql server 2005 Jade-Software6
How do you troubleshoot SQL Server if its running very slow?  2
Please get the 4 th maximum salary from a table without using any sql keyword (TOP,MAX are mot allowed)  5
How to write stored procedure to update the data in 10 tables  4
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com