Showing posts with label statement. Show all posts
Showing posts with label statement. Show all posts

Wednesday, March 21, 2012

Rename a table with a SQL

Hello guys,
is it possible to rename a table with a SQL statement ?
Thanks
Hi Serge
Take a look at sp_rename in the Books Online.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Serge Fournier" <safournier@.free.fr> wrote in message
news:ugihcRlzEHA.3840@.tk2msftngp13.phx.gbl...
> Hello guys,
> is it possible to rename a table with a SQL statement ?
> Thanks
>
|||Thanks
"Kalen Delaney" <replies@.public_newsgroups.com> a crit dans le message de
news: %23pKhWilzEHA.3204@.TK2MSFTNGP10.phx.gbl...
> Hi Serge
> Take a look at sp_rename in the Books Online.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Serge Fournier" <safournier@.free.fr> wrote in message
> news:ugihcRlzEHA.3840@.tk2msftngp13.phx.gbl...
>
sql

Tuesday, March 20, 2012

Rename A Field Using SQL Statement?

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
dbWhat 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
--