Table of Contents
SQL Server Error: 120
Severity: 15
Event Logged or not: No
Description:
The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.
Severity 15 Description:
Indicates syntax errors in the Transact-SQL command.
This issue happens when the number of values supplied in the VALUES Select Statement is less than the number of columns specified in an INSERT to a table using the INSERT INTO… VALUES format, as described in the error message.
The following INSERT statement, for example, will result in an error:
INSERT Into [Alpha] ( [Name], [LastName], [Gender] )
select name, lastname from one
The INSERT INTO clause specifies three columns, while the VALUES of select statement specifies just two values, as can be seen in this INSERT INTO… statement.
To avoid this error, make sure that the number of values specified in the VALUES Select Statement matches the number of columns specified in the INSERT INTO clause:
INSERT Into [Alpha] ( [Name], [LastName], [Gender] )
select name, lastname,gender from one
SQL Server Error Code and solution summary
SQL Server Error: 120
Severity: 15
Event Logged or not: No
Description:
The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.
To avoid this error, make sure that the number of values specified in the VALUES clause matches the number of columns specified in the INSERT INTO clause:
INSERT Into [Alpha] ( [Name], [LastName], [Gender] )
select name, lastname,gender from one
Learn about SQL Server detecting logical consistency based issues and how to resolve them.
Learn about SQL Server error 1222 and how to resolve the lock request time out…
Discover the new features of Microsoft SQL Server 2022 and how they compare to previous…
SQL Server Error 1222 lock request time out period exceeded Lock request time out…
SQL Server Error : 427, Severity: 20. Could not load the definition for constraint ID…
SQL Server Error : 204, Severity: 20. Normalization error in node %ls.
This website uses cookies.