Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    74

    Unanswered: The multi-part identifier "CallLog.ProductName" could not be bound

    hi

    I'm geting the following error when running this sql. Can any help?

    select * from CallLog
    update [HEAT].[dbo].[Detail]
    set [Detail].[ProductName] = [CallLog].[ProductName]

    Msg 4104, Level 16, State 1, Line 2
    The multi-part identifier "CallLog.ProductName" could not be bound.

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Your syntax is all bollixed up.

    "select * from CallLog"
    and
    "update [HEAT].[dbo].[Detail]
    set [Detail].[ProductName] = [CallLog].[ProductName]"
    are two separate statements. The second one is separate from the first, and hence does not reference that table.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    The error s caused by the UPDATE statement. You need to rewrite it (the key names are assumed):

    update d
    set ProductName = cl.ProductName
    from [HEAT].dbo.Detail d
    inner join dbo.CallLog cl
    on d.ProductID = cl.ProductID -- Replace with actual key names
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •