Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sybase

 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic