Subject Re: Copy paste tables
Author throwmail2000
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> > What's the easy way to copy table(without data)?
> >
> > I tried 'insert into mytable2 select * from mytable1 where 1=0;
> >
> > This did created mytable2 table, but it didn't copied the damin names
> > and instead put the firebird native data type as field types.
> > I ran the above query in IBExpert.
> >
> > Also when I looked into DDL there were no Trigger or generator
> > for mytable2, mytable1 has one trigger and 1 generator.
> >
> > Thanks
> >
>
> just extract the metadata for the table (easy in IBExpert), then
edit the
> script to change the name of the table and run it using the current
> connection - you get all metadata the same
> Alan

Thanks, that worked perfectly.
If Firebird could create and associate Domain's based on source table
in 'insert into mytable2 select * from mytable1' that would be
very convenient especially for people migrating from other databases
or people who are creating large number of tables.
Maybe this is a wishlist candidate.