Lets suppose You have executed the given query in SQL SERVER .
INSERT INTO EMPLOYEE (NAME, SALARY)
SELECT NAME, SALARY,CONTACTNO FROM EMPLOYEE1
Error Message :
But getting the below error.
Msg 121, Level 15, State 1, Line 1
The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns.
Causes:
Number of column in select Statement is greater than Number of columns which specified in INSERT Statement that’s why it is showing an error as “Number of select values must match the number of insert statement.”
Solution of the Error:
To avoid this type of error, Please ensure that
Number of column in Select Statement = Number of columns which specified in INSERT Statement
INSERT INTO EMPLOYEE (NAME, SALARY, CONTACTNO)
SELECT NAME, SALARY ,CONTACTNO FROM EMPLOYEE1
Another way:
INSERT INTO EMPLOYEE (NAME, SALARY)
SELECT NAME, SALARY FROM EMPLOYEE1
If you want to sell your readymade software to the genuine clients or businessman, list your software with details and demo links.
Clients will find it using our advanced search filter and will contact you directly.
No any charge for the product lsiting.