Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a copy of an Sybase table with data?

Tags:

sap-ase

I know the statement in oracle which copies the structure and the data.

create table mytable1 as select * from mytable;

But how to achieve the same in Sybase ASE?

like image 952
Anil Purswani Avatar asked Apr 10 '12 11:04

Anil Purswani


2 Answers

It is possible using select into!

Check more info HERE!

like image 72
aF. Avatar answered Nov 13 '22 09:11

aF.


In Sybase ASE 16 the syntax for copying the data and structure is

SELECT field1, field2 INTO NewTable FROM OldTable

If you want to copy only the structure use this

SELECT field1, field2 INTO NewTable FROM OldTable WHERE 1=0
like image 39
Doberon Avatar answered Nov 13 '22 10:11

Doberon