Re: Rename table
From: Adam Machanic (amachanic_at_air-worldwide.nospamallowed.com)
Date: 03/15/04
- Next message: Itzik Ben-Gan: "Re: Rename table"
- Previous message: Tibor Karaszi: "Re: Rename table"
- In reply to: GeoWorks: "Rename table"
- Next in thread: Itzik Ben-Gan: "Re: Rename table"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Mar 2004 10:09:24 -0500
You can use sp_rename ... Look it up in BOL.
Note, this isn't an ANSI SQL statement. I don't know of any way to rename a
table in pure SQL other than creating a new table and moving all of the
data.
"GeoWorks" <rcetrangolo@geoworks.com.uy> wrote in message
news:88A6B4A5-69F8-4D87-B002-BBC054170A8B@microsoft.com...
> I want to rename a table using an SQL statement.
> I know in many data bases I can write 'ALTER TABLE pp RENAME TO pp2' to
change the name of 'pp' table to 'pp2'.
> It seems doesn't work in SQL Server.
> There is a way to rename a table using only ANSI SQL statement?, I meen
I'm not programming over the database, I'm just progamming an upper layer to
writes SQL scripts to merge database models and I have to rename certain
tables to preserve its values (if there are some) and then try to copy
values to the new table definition (if it is possible).
>
> Thanks
- Next message: Itzik Ben-Gan: "Re: Rename table"
- Previous message: Tibor Karaszi: "Re: Rename table"
- In reply to: GeoWorks: "Rename table"
- Next in thread: Itzik Ben-Gan: "Re: Rename table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|