On Transact SQL language the Msg 207 Level 16 - Invalid column name means that we have in our statement the column name misspelled.
Msg 207 Level 16 Example:
We have the table mytable.
Id | Name |
---|---|
1 | Object 1 |
2 | Object 2 |
Invalid column name:
USE model;
GO
SELECT id, name123 FROM mytable;
GO
Message |
---|
Msg 207, Level 16, State 1, Line 1 |
Invalid column name 'name123'. |
Correct column name:
USE model;
GO
SELECT id, name FROM mytable;
GO
Id | Name |
---|---|
1 | Object 1 |
2 | Object 2 |
Other error messages:
- There are more columns in the INSERT statement than values specified in the VALUES clause
- Must declare the scalar variable
- Is not a recognized datepart option
- The definition for column must include a data type
- Is not a recognized built-in function name
- Operand type clash: int is incompatible with date
- Invalid object name