Column name or number of supplied values does not match table definition

前端 未结 12 1825
轮回少年
轮回少年 2020-11-29 04:33

In SQL server, I am trying to insert values from one table to another by using the below query:

delete from tblTable1

insert into tblTable1 select * from tb         


        
12条回答
  •  我在风中等你
    2020-11-29 04:59

    This is an older post but I want to also mention that if you have something like

    insert into blah
           select * from blah2
    

    and blah and blah2 are identical keep in mind that a computed column will throw this same error...

    I just realized that when the above failed and I tried

    insert into blah (cola, colb, colc)
           select cola, colb, colc from blah2
    

    In my example it was fullname field (computed from first and last, etc)

提交回复
热议问题