aspose file tools
The moose likes JDBC and the fly likes sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "sybase" Watch "sybase" New topic
Author

sybase

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
how to create a temp copy of a table in sybase ie. like,
create table t2 like t1
[ August 30, 2004: Message edited by: Bear Bibeault ]

God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
When you say "temp table" do you mean a temporary, i.e. # table, or a temporary copy of a permanent table?

The simplest way to do either is with SELECT INTO. Note that SELECT INTO is not really suitable for production use due to issues with locking and logging (lack thereof).

You have to be SA or DBO to do the above. Note that it won't copy constraints, indexes, etc. If you only want a temporary table (lasts as long as your session) do the following:

Jules
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: sybase
 
Similar Threads
select all the colums although some empty/null
doubt in sybase
creating table in MS-Access table from sybase database
WL or WS?
How to know the modification time of a table in Sybase