• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sybase

 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic