Re: Rename table
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 03/15/04
- Next message: Adam Machanic: "Re: Rename table"
- Previous message: Itzik Ben-Gan: "Re: Complex Script to Disallow Nulls in One Column?"
- In reply to: GeoWorks: "Rename table"
- Next in thread: Adam Machanic: "Re: Rename table"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Mar 2004 16:08:25 +0100
There is no ANSI SQL way to rename a table (in the ANSI SQL standard). This
is the reason (methinks) why MS haven't introduced renaming a table using
ALTER TABLE. In SQL Server, you use sp_rename to rename a database object.
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp "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: Adam Machanic: "Re: Rename table"
- Previous message: Itzik Ben-Gan: "Re: Complex Script to Disallow Nulls in One Column?"
- In reply to: GeoWorks: "Rename table"
- Next in thread: Adam Machanic: "Re: Rename table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|