SQL Server – The multi-part identifier could not be bound State – Msg 4104 – Fix

Error Msg

Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier could not be bound.

Cause of this Error Msg:

Case: 1

This error usually occurs when an alias is used when referencing a column in a SELECT statement and the alias used is not defined anywhere in the FROM clause.

Case: 2

This error occurs if we are using the tables from the two different databases in the join statement and not using the table alias for the same.

Error SQL

Select * 
From DB1.dbo.table1
Join DB2.dbo.table2 on table1.column1 = table2.column2

Correct SQL 

Select * 
From DB1.dbo.table1 t1 
Join DB2.dbo.table2 t2 on t1.column1 = t2.column2

If have any suggestion/comment, please share.

3 comments