How do I Modify a Column Name via script

  • Thread starter Thread starter Ather Ali Shaikh
  • Start date Start date
A

Ather Ali Shaikh

Hello All,
How do I change SqlServer Table's Column name from 'ColumnA' to 'ColumnB'
through the
script . But the CoulmnA has already data in it, which is not supposed to be
destroyed.

Thanks for last solution.

Regards,


--
Ather Ali Shaikh
Software Engineer
eIntelligence (Pvt.) Limited.
Ph. (+92-21) 2434070, 2415929-30
email. (e-mail address removed)
web. www.eintelligencesoft.com
 
ALTER TABLE

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
I believe you should be looking a the sp_rename system procedure...
the syntax if something like...(from online help)

This example renames the contact title column in the customers table to
title.

EXEC sp_rename 'customers.[contact title]', 'title', 'COLUMN'


Alternatively you can right click on the table in Enterprise Manager and
select

'design table' and make your changes there


Hope this helps
 
Back
Top