The column prefix ‘A’ does not match with a table name or alias name used in the query

Error Message:

Msg 107, Level 15, State 1, Line 1
The column prefix ‘A’ does not match with a table name or alias name used in the query.

This error occurs when the correct table name/alias is not used in the select query.

Example:
[sql]
SELECT a.* FROM SYS.tables
[/sql]

When you execute the above code you get error message Msg 107.

Fix/Resolution:
Correct the select list with the correct table names or alias names.

[sql]
SELECT sys.tables.* FROM sys.tables
[/sql]

[sql]
SELECT tables.* FROM sys.tables
[/sql]

[sql]
SELECT T.* FROM sys.tables T
[/sql]

Leave a Reply

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