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. – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Thu, 17 May 2012 05:05:11 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 The column prefix ‘A’ does not match with a table name or alias name used in the query https://sqlserverlearner.com/2012/05/17/the-column-prefix-a-does-not-match-with-a-table-name-or-alias-name-used-in-the-query/ https://sqlserverlearner.com/2012/05/17/the-column-prefix-a-does-not-match-with-a-table-name-or-alias-name-used-in-the-query/#respond Thu, 17 May 2012 05:05:11 +0000 https://sqlserverlearner.azurewebsites.net/2012/05/17/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]

]]>
https://sqlserverlearner.com/2012/05/17/the-column-prefix-a-does-not-match-with-a-table-name-or-alias-name-used-in-the-query/feed/ 0