Groups | Blog | Home
all groups > sql server connect > june 2006 >

sql server connect : Rename A Field Using SQL Statement?


ods
6/2/2006 1:08:18 PM
Is there a way that i can rename some fields in a table using SQL from my
..NET program? The customer send sthem in as BMT Number and I need
BMT_Number, etc.

Thanks
Jens
6/2/2006 10:10:02 PM
What about looking in the BOL, there is an example for tenaming
columns:

Renaming a column
The following example renames the TerritoryID column in the
SalesTerritory table to TerrID.

Copy Code
USE AdventureWorks;
GO
EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';
GO



HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---
AddThis Social Bookmark Button