Calendar

September 2010
S M T W T F S
« Jul    
 1234
567891011
12131415161718
19202122232425
2627282930  

SQL Change column name in table

Using the Query Analyzer may not be the right way always, you can use the SQL syntax as given below, if you are unable to have access to use the query analyzer

For Oracle 9i, the syntax is :
ALTER TABLE table_name
RENAME COLUMN old_name to new_name;

For Microsoft SQL the syntax is :
EXEC sp_rename ‘Table.[OldColumnName]‘, NewColumnName, ‘COLUMN’

*Note here the alst terms ‘COLUMN’ is a must.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • PDF
  • RSS
  • Twitter
  • Yahoo! Bookmarks
  • email

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">