Insert into table

  • Hi,

    I have to insert into a table (t2) from other table (t1) with stored proc. I will use insert into t2.. select .. from t1, but I have to insert some additional field that are not part of t1, this is basically a variable.

    here is the scenario

    var = SidKey (col3)

    Insert into t2 (col1,col2,col3)

    select

    col1,

    Col2,

    from t1

    now will it be possible that I may include SidKey as Col3 ?

  • Insert into t2 (col1,col2,col3)

    select

    col1,

    Col2,

    @Variable

    from t1

    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
  • thank you Gail Shaw

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

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