var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: copy a table using sql
Hi Everyone -
I need to create a temp database based on the schema
of an existing table...
how do i accomplish this in SQL??
I was thinking something like....
create table tbladt_copy select * from tbladt where 1=0
There is a dbunload utility that is in your win32 and also available via the Sybase Central "utilities" folder. The wizard will walk you through the process. It is very straight forward.
Once you have your schema unloaded, create a new instance on the same server using dbinit utility and then in Interactive sql;
You can achieve this in sql, by having the second database as proxy on the source.
Last edited by willy_and_the_ci; 11-01-05 at
Thanks for the reply -
I am trying to complete the task via a script...
all those command line tools are nice,
but i would like to create a new empty table
based on the schema of an existing table
using t-sql (script)
sorry to mislead you
thanks again for the reply.
The normal method in T-SQL is:
select ... into NEW_TABLE
from OLD_TABLE where 1=0
tried that syntax....
only works for temp tables in ASA 7
thanks for the reply
I don't know ASA - with ASE you have to enable the "select into" option for the database. Maybe ASA has a similar configuration parameter?
ASA each database is a seperate instance. Although you can start all the databases under a single engine. To copy from one to another database, you either need to use the proxy services or via the utility that I mentioned before.
Sorry it took so long to post a response
i couldn't find a way to copy the schema of a table
into a new table under ASA 7
so in the script, i created a copy table based on the
script used to create the original table -
and at the end of the script, i drop the copy table.
worked like a champ
thanks for the replies