Results 1 to 4 of 4

Thread: copy the Table Structure

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Answers
    28

    copy the Table Structure

    Hi
    I want to copy the structure & all constrains of one table into other table.

    There is any Direct query is there without using Sql Scirpt???


  2. #2
    Expert Member
    Join Date
    May 2006
    Answers
    114

    Re: copy the Table Structure

    You have a function called as copy function in SQL server which you can use to copy the structure and all constrains of one table into other table. If you want to make a clone of the same table with structure, constraints and data you can make use of clone function available with SQL server.


  3. #3
    Junior Member
    Join Date
    Jul 2007
    Answers
    5

    Re: copy the Table Structure

    create table tablename 1 from select * from tablename2


  4. #4
    Junior Member
    Join Date
    Aug 2007
    Answers
    7

    Re: copy the Table Structure

    Using INTO we can copy..

    SELECT TOP 0 * INTO New_Table_Name From Old_Table_Name

    The Above query will come only the structure for the table..

    If U want to copy with the data then remove the "Top 0 "..

    SELECT * INTO New_Table_Name FROM Old_Table_Name


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact