CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    112

    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

  2. #2
    Join Date
    Sep 2006
    Posts
    635

    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
  •  





Click Here to Expand Forum to Full Width

Featured