multi-part identifier could not be bound

  • I am getting:

    The multi-part identifier "TEX.Enroll_Trlr.Dtl_Count" could not be bound. I pasted in the filename so I know it's right.

    Thanks a lot

    DECLARE @Run_Date as int

    DECLARE @DTL_CNT as int

    SET @Run_Date = Convert(Varchar(10),Getdate(),112)

    SET @DTL_CNT = (SELECT count(*)

    FROM TEX.Enroll_Dtl, TEX.Enroll_Trlr

    WHERE TEX.Enroll_Dtl.RunDate = @Run_Date And TEX.Enroll_Trlr.Vendor_Name = 'CFS'

    And TEX.Enroll_Dtl.Vendor_File_Name = TEX.Enroll_Trlr.Vendor_File_Name)

    IF @DTL_CNT <> Enroll_Trlr.Dtl_Count

    BEGIN

    print 'goto QUIT'

    Exec TEX.sp_Enrollment_Error_handler

    END

    SET @DTL_CNT = (SELECT count(*)

    FROM TEX.Enroll_Dtl, TEX.Enroll_Trlr

    WHERE TEX.Enroll_Dtl.RunDate = @Run_Date And TEX.Enroll_Trlr.Vendor_Name = 'GNA'

    And TEX.Enroll_Dtl.Vendor_File_Name = TEX.Enroll_Trlr.Vendor_File_Name)

    IF @DTL_CNT <> TEX.Enroll_Trlr.Dtl_Count

    BEGIN

    print 'goto QUIT'

    Exec TEX.sp_Enrollment_Error_handler

    END

    SET @DTL_CNT = (SELECT count(*)

    FROM TEX.Enroll_Dtl, TEX.Enroll_Trlr

    WHERE TEX.Enroll_Dtl.RunDate = @Run_Date And TEX.Enroll_Trlr.Vendor_Name = 'SYN'

    And TEX.Enroll_Dtl.Vendor_File_Name = TEX.Enroll_Trlr.Vendor_File_Name)

    IF @DTL_CNT <> TEX.Enroll_Dtl.Dtl_Count

    BEGIN

    print 'goto QUIT'

    Exec TEX.sp_Enrollment_Error_handler

    END

    END

  • Don't use three-part-names for the columns. SQL 2005 doesn't support that. Use the table and column name only.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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