dbTalk Databases Forums  

Copy Table structure and data

comp.databases.sybase comp.databases.sybase


Discuss Copy Table structure and data in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM






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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #12  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM






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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #13  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM



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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #14  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM



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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #15  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM



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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #16  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM



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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
  #17  
Old   
gubba.venkatesh@gmail.com
 
Posts: n/a

Default Re: Copy Table structure and data - 10-28-2008 , 10:38 AM



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.



Carl Kayser wrote:
Quote:
gopi.anoop (AT) gmail (DOT) com> wrote in message
news:6ff9e039-b35e-403d-8d45-3df318630e18 (AT) x35g2000hsb (DOT) googlegroups.com...
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,

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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.