Home » SQL Server Error : 121, Severity: 15. The select list for the INSERT statement

SQL Server Error : 121, Severity: 15. The select list for the INSERT statement

SQL Server Error : 121 Details


SQL Server Error: 121
Severity: 15
Event Logged or not: No
Description:
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.
Severity 15 Description:
Indicates syntax errors in the Transact-SQL command.

Solution for Resolving the Error

Cause for the Error

This issue happens when the number of values supplied in the VALUES clause 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],  [Gender] )
select name, lastname, gerner from one

The INSERT INTO clause specifies three columns, while the VALUES clause specifies just two values, as can be seen in this INSERT INTO… VALUES statement.

Solution for Resolving the Error

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 [dbo].[Alpha] ( [Name], [LastName], [Gender] )
select name, lastname, gerner from one

SQL Server Error Code and solution summary


SQL Server Error: 121
Severity: 15
Event Logged or not: No
Description:
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.

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 [dbo].[Alpha] ( [Name], [LastName], [Gender] )
select name, lastname, gerner from one

Leave a Reply

Your email address will not be published. Required fields are marked *