Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL server - Msg 213 - Insert Error: Column name or number of supplied values does not match table definition

Tags:

sql-server

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 tblTable1_Link

I am getting the following error :

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

I am sure that both table having same structure, column names and same data type.

Thank you for your help. I have tried posting this to sqlsvrtip but I got no response so I though I would try here are there seems to be way more activity.

like image 503
NickJH Avatar asked Oct 15 '22 01:10

NickJH


1 Answers

Is one of the columns an IDENTITY column?

SET IDENTITY_INSERT tblTable1 ON
insert into tblTable1 select * from tblTable1_Link
SET IDENTITY_INSERT tblTable1 OFF
like image 135
Fosco Avatar answered Oct 19 '22 03:10

Fosco