Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Sybase Topics / October 2008

Tip: Looking for answers? Try searching our database.

Copy Table structure and data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gopi.anoop@gmail.com - 30 Sep 2008 12:51 GMT
Hi,
 I have one table named "table2".
I wanted to create one new table "table1" having the exact data
structure of "table1".
In Oracle we can do like,
 create table table1 as
 select *
 from table2;

Pls tell the query for SYBASE

Regards,
Carl Kayser - 30 Sep 2008 13:44 GMT
> Hi,
>  I have one table named "table2".
[quoted text clipped - 8 lines]
>
> Regards,

Offhand, you have to set the database (rough equivalent to Oracle schema)
option to allow the "select into" option.  Then you can

select * into new_table from old_table

And then you should do a backup since this is a minimally logged operation.
(And turn off the option if it is unneeded.)  A problem is that new_table
will NOT inherit any check or rule constraints nor any indexes.  The column
definitions will not be for a usertype (if old_table used any) but for a
base type.
gubba.venkatesh@gmail.com - 28 Oct 2008 17:38 GMT
When I tried to run the query "select * into new_table from old_table"
i received error message.

Then I ahve created a new table with description, then i ran the query
"Insert into new_table select * from old_table.

> > Hi,
> >  I have one table named "table2".
[quoted text clipped - 19 lines]
> definitions will not be for a usertype (if old_table used any) but for a
> base type.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.