Board index » delphi » table renaming

table renaming

Hello!

How can a table be safely renamed in IB6?

Bye!
VB

 

Re:table renaming


Quote
In article <3b3c4e23_2@dnews>, Valerye Bostan wrote:
> How can a table be safely renamed in IB6?

The safe way is to create the new table with the correct name and do a:

insert into newtable select * from old table;

(You might have to play with the syntax a little).

Once you have moved the data, drop the old table.

hth

Robert Schieck (TeamB)
MER Systems Inc.
Inprise/Borland/InterBase Search Engine
http://www.mers.com/searchsite.html

Re:table renaming


Quote
"Robert Schieck" <rschi...@mers.com> wrote in message

news:VA.0000016a.044adfc5@mers.com...
Quote
> In article <3b3c4e23_2@dnews>, Valerye Bostan wrote:
> > How can a table be safely renamed in IB6?

> The safe way is to create the new table with the correct name and do a:

> insert into newtable select * from old table;

> (You might have to play with the syntax a little).

> Once you have moved the data, drop the old table.

Thanks!

Oops, just as I feared...
In MSSQL there is a useful sp_rename proc.

In my case I need to make two of such transfers, because finally I need the
same table with some metadata changed.

Bye!
VB

Re:table renaming


Then use ALTER TABLE for add, drop or modify columns and constraints.

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

"Valerye Bostan" <r...@master.md> escribi en el mensaje
news:3b3c7f32_1@dnews...

Quote

> "Robert Schieck" <rschi...@mers.com> wrote in message
> news:VA.0000016a.044adfc5@mers.com...
> > In article <3b3c4e23_2@dnews>, Valerye Bostan wrote:
> > > How can a table be safely renamed in IB6?

> > The safe way is to create the new table with the correct name and do a:

> > insert into newtable select * from old table;

> > (You might have to play with the syntax a little).

> > Once you have moved the data, drop the old table.
> Thanks!

> Oops, just as I feared...
> In MSSQL there is a useful sp_rename proc.

> In my case I need to make two of such transfers, because finally I need
the
> same table with some metadata changed.

> Bye!
> VB

Other Threads