How can i change the column name.

Answers were Sorted based on User's Feedback



How can i change the column name...

Answer / durgaprasad

sp_rename 'tablename.oldcolumnname','newcolumnname'

Is This Answer Correct ?    31 Yes 3 No

How can i change the column name...

Answer / kinthada cnu

hi all

sp_rename 'tablename.oldcolumnname','newcolumnname','column'

Is This Answer Correct ?    18 Yes 4 No

How can i change the column name...

Answer / ramesh5782

ALTER TABLE table_name
RENAME COLUMN old_name to new_name;

Is This Answer Correct ?    22 Yes 17 No

How can i change the column name...

Answer / harsh v m

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 ?    4 Yes 0 No

How can i change the column name...

Answer / sanjay

ALTER TABLE tablename CHANGE oldname newname varchar (10) ;

Is This Answer Correct ?    3 Yes 0 No

How can i change the column name...

Answer / y.narendra kumar

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 ?    4 Yes 2 No

How can i change the column name...

Answer / naren

update tablename set newcolumn name where old column name

Is This Answer Correct ?    0 Yes 0 No

How can i change the column name...

Answer / dipti sonawane

alter table (table_name)
change (old_colomnname)(new_colomnname)

Is This Answer Correct ?    0 Yes 0 No

How can i change the column name...

Answer / om

the alter command is used to do modification at column level . so in order to change the name of a column we need to use alter .

command:- alter table (table name) rename (old column name) to (new column name)
note :- dont put brackets its just for u to understand

Is This Answer Correct ?    0 Yes 0 No

How can i change the column name...

Answer / sonia

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 ?    3 Yes 6 No

Post New Answer

More SQL Server Interview Questions

What is the default fill factor value?

0 Answers  


What is the difference between Stored Procedure , Function and Package, 1. how many blocks in Package and what are they.

5 Answers   IBM,


What are the different types of columns types constraints in the sql server?

0 Answers  


Who developed sql server?

0 Answers  


What is the optimization being performed in oracle and SQL Server?

0 Answers   Cap Gemini,






You want to implement the one-to-many relationship while designing tables. How would you do it?

0 Answers  


how to retrive only second row from table in sql server 2000?

15 Answers   Cognizant, CTS,


Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?

0 Answers  


why would you call update statistics? : Sql server database administration

0 Answers  


how to copy only distinct data into another table which is not already exist in database?

2 Answers   Spectra,


1. What is CUBE Operator? 2. what are the new data types are available in sql server 2008? 3. Inisde a nested queries, how many subqueries u can have?

3 Answers  


what are user defined datatypes? : Sql server database administration

0 Answers  


Categories