Need to copy a block of records within same table

  • If timestampstr is an automatically generated value, then it's easy. don't mention the column in the insert or the select.

    It it's not autogenerated, then you need to find out how it's generated and generate a unique one for every record.

    Try this.

    Insert into Service (GroupNo,ServiceCode,ServiceName,SystemNo,Upload)

    SELECT 6,ServiceCode,ServiceName,SystemNo,Upload

    FROM Service

    WHERE GroupNo=1

    What do you mean by "the primary key do not allow sql statement at all." ?

    Can you post the schema of the table?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing post 16 (of 16 total)

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