File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java Interview Guide
this week in the
JDBC and Relational Databases
Joined: Oct 09, 2003
Aug 30, 2004 04:52:00
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
Joined: Aug 02, 2004
Aug 30, 2004 10:01:00
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).
SELECT * INTO my_new_table FROM my_old_table
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:
SELECT * INTO #my_temp_table FROM my_old_table
I agree. Here's the link:
doubt in sybase
WL or WS?
How to know the modification time of a table in Sybase
creating table in MS-Access table from sybase database
select all the colums although some empty/null
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015