Ask Paula!

...bringing you notes from the field...
posts - 55, comments - 17, trackbacks - 0

My Links

News

Article Categories

Archives

Post Categories

.NET Development

Enterprise Integration

Java Development

Mobile/PDA Development

Professional Affiliations

SQL Server: Why do I get "multi-part identifier could not be bound" ?

 

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

 

Print | posted on Thursday, August 06, 2009 4:13 PM | Filed Under [ SQL ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: