Let's say you've developed a stored procedure that assigns a count value to a variable which looks like this:
SELECT @HasDefaultShipTo = count(*)
FROM StakeHolderLoc_Assoc
WHERE assoc.StakeHldrID = @StkhldrID
When you execute to compile you will see the error:
Msg 4104, Level 16, State 1, Procedure MetroDevETL_1, Line 80
The multi-part identifier "assoc.StakeHldrID" could not be bound.
The reason this error appears is because you have forgotten to associate/bind the table to "assoc". The corrected SQL will look like this:
SELECT @HasDefaultShipTo = count(*)
FROM StakeHolderLoc_Assoc assoc
WHERE assoc.StakeHldrID = @StkhldrID