Results 1 to 3 of 3

Thread: copying a table

  1. #1
    Join Date
    Jan 2004

    Unanswered: copying a table

    I am assuming there is some functionality to copy and paste a table in sql server..however I am not seeing where I can do this what I want to do is this:

    create table1 as select * from table 2;

    Please let me know how I can create a new table as a replica of an existing table. Thanks so much!

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 17
    Sounds like Oracle syntax there. There is an analog in SQL Server, though

    Select * into copytable
    from sourcetable

    This won't bring over indexes, primary keys, foreign keys, or identity columns, but it does bring the bare table structure, and the data.

  3. #3
    Join Date
    Jan 2004
    thanks. Yep I am having a big of a syntax issue here. I am more of an Oracle person! Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts