-
March 22nd, 2012, 02:43 PM
#1
multi-part identifier could not be bound
Hi, I'm having an issue with my SQL Statement. I'm trying to declare a variable and set it to the count of the number of records that exist for a particular order number. The problem is when I execute the statement I get this error:
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "prod.dbo.HEADERS.ORDER_NUMBER" could not be bound.
I'm 100% Sure everything is spelled correctly and capitalized properly. This is the code I'm trying to run:
Code:
DECLARE @test INT
SET @test = (SELECT COUNT(*) FROM [prod].[dbo].[LINES] WHERE [ORDER_NUMBER] = [prod].[dbo].[HEADERS].[ORDER_NUMBER])
Any idea what might be causing this? Thank you.
- It's a long way to the top if you want to rock n' roll - AC/DC
Check out my band and support the music:
www.blueruinmusic.com
-
March 25th, 2012, 10:06 AM
#2
Re: multi-part identifier could not be bound
hi vandel
your statement is on table Lines and not on Headers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|