同一个数据库: 表格A: 
int userId
decimal amount表格B:
int userId
decimal amount
datetime createdDate如何复制表格A的所有数据到表格B, 并使 createDate=GetDate() ?

解决方案 »

  1.   

    insert into B(userid,amount,createdDate)
    select userid,amount,getdate()
    from A
      

  2.   


    INSERT INTO B SELECT userId, amount, GetDate() FROM A
      

  3.   

    insert into B select userId ,amount ,getdate() from A
      

  4.   

    insert into B(userid,amount,createdDate) select userid,amount,getdate() from A
      

  5.   

    insert into 表格B(userId,amount,createdDate)
    select userId,amount,getdate() from 表格A
      

  6.   

    insert into B(userId,amount,createdDate) select userId ,amount ,getdate() from A