How to copy records in same table as new entry

  • Hi,

    I have a table having 20 records, the columns are:

    ID (identity column), companyid,.......

    , and I want to copy these 20 records and insert into this same table with

    only different companyid.

  • Something of this sort

    INSERTINTO TableName( List of coloumns ) -- Columns other than the IDENTITY Column

    SELECTList of coloumns -- Columns other than the IDENTITY Column

    FROMTableName


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply