The multi-part identifier could not be bound.

  • Hey all,

    I'm trying to select into an existing table whilst matching customer IDs but its coming up with the error -->

    The multi-part identifier "dbo.tblCUSTOM281009.icustID" could not be bound.

    The code:

    SELECT iSalutation

    INTO dbo.tblCUSTOM281009

    FROM dbo.tblCustPerson

    WHERE dbo.tblCustPerson.iCustID = dbo.tblCUSTOM281009.icustID

    order by iSalutation

    The idea is to select the corresponding iSalutation(eg 1,2,3 etc) and then match it to the icustID (1, 2, 8000).

    Thank you for your help.

  • The problem is your where clause. You are doing an equal statement on two different tables but haven't actually joined them together.

    I am guessing the "dbo.tblCUSTOM281009" in your where clause should be "dbo.tblCustPerson"

    cronicavenger (10/27/2009)


    Hey all,

    I'm trying to select into an existing table whilst matching customer IDs but its coming up with the error -->

    The multi-part identifier "dbo.tblCUSTOM281009.icustID" could not be bound.

    The code:

    SELECT iSalutation

    INTO dbo.tblCUSTOM281009

    FROM dbo.tblCustPerson

    WHERE dbo.tblCustPerson.iCustID = dbo.tblCUSTOM281009.icustID

    order by iSalutation

    The idea is to select the corresponding iSalutation(eg 1,2,3 etc) and then match it to the icustID (1, 2, 8000).

    Thank you for your help.

  • Don't know if I understand what exactly you want.

    Insert InTo tblCUSTOM281009(iSalutation )

    SELECT iSalutation

    FROM dbo.tblCustPerson

    Inner Join dbo. tblCUSTOM281009 On dbo.tblCustPerson.iCustID = dbo.tblCUSTOM281009.icustID

    order by dbo.tblCustPerson.iSalutation

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply