loads of useful information, examples and tutorials pertaining to web development utilizing asp.net, c#, vb, css, xhtml, javascript, sql, xml, ajax and everything else...

 



Advertise Here
C-Sharpener.com - Programming is Easy!  Learn Asp.Net & C# in just days, Guaranteed!

Change column name in a MSSQL table

by naspinski 12/25/2008 5:16:00 AM

For some reason, MS does not have a built in command for this?


Not sure why this is as competeing technologies like Oracle and MySQL do, but there is a stored procedure that will get you where you are going:
EXEC sp_rename 'TABLENAME.OLD_COLUMNNAME', 'NEW_COLUMNAME', 'COLUMN';

Just replace TABLENAME.OLD_COLUMNNAME and NEW_COLUMNNAME with your new values.

Currently rated 3.1 by 11 people

  • Currently 3.090909/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

sql

Related posts


Comments are closed