How can i change the column name.
Answers were Sorted based on User's Feedback
Answer / durgaprasad
sp_rename 'tablename.oldcolumnname','newcolumnname'
Is This Answer Correct ? | 31 Yes | 3 No |
Answer / kinthada cnu
hi all
sp_rename 'tablename.oldcolumnname','newcolumnname','column'
Is This Answer Correct ? | 18 Yes | 4 No |
Answer / ramesh5782
ALTER TABLE table_name
RENAME COLUMN old_name to new_name;
Is This Answer Correct ? | 22 Yes | 17 No |
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 |
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 |
Answer / naren
update tablename set newcolumn name where old column name
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / dipti sonawane
alter table (table_name)
change (old_colomnname)(new_colomnname)
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
What is difference between join and natural join?
What are the new features in SQL Server 2005?
How to fetch the next row from a cursor with a "fetch" statement?
Relational calculus is what type of language?
List out a number of the wants to setup a SQL Server failover cluster?
How to enter binary string literals in ms sql server?
Explain about Joins?
Which are the important points to note when multilanguage data is stored in a table?
sql server has its default date format in da form "yy-mm-dd" its possible to convert da current date format of sql server to desired format. Now my question is dat how to get da previous and comin days date in my desired format??
How are the exceptions handled in sql server programming?
What is Index Segmentation ?