Link to home
Start Free TrialLog in
Avatar of rbhargaw
rbhargawFlag for United States of America

asked on

Multi-part identifier could not be bound

Hello,

I am trying to migrate Sybase stored procedures into SQL server 2008 using SSMA.  So I received the following error "Non-ANSI join operator cannot be converted in this statement" inside the code..and hence I am working on to remove this error..Here is what i am trying to do...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

         UPDATE t
            SET
               status = c.statusId,
               descr = corr.descrip + ': ' + mdg.descrip
         FROM
            #t_trandata  AS t,
            dbo.Correspondence  AS c,
           -- dbo.CorrMeth  AS corr,
            dbo.MailDocGrp  AS mdg
           LEFT JOIN CorrMeth AS corr on corr.corrMethID = dbo.Correspondence.corrMethId
         WHERE
            t.holdTypeID = 13 AND
            t.holdId = c.holdId AND
           --c.corrMethId *= corr.corrMethID AND
            c.mailDocGrpId = mdg.mailDocGrpID
---------------------------------------------------------------------------------

But I am receiving the following error while running the SP

The multi-part identifier "dbo.Correspondence.corrMethId" could not be bound.

Let me know what I am doing wrong?

Thanjks
Existing Code:
----------------------------


         /* 
         *   SSMA error messages:
         *   S2SS0062: Non-ANSI join operator cannot be converted in this statement.

        UPDATE t
            SET 
               status = c.statusId, 
               descr = corr.descrip + ': ' + mdg.descrip
         FROM 
            #t_trandata  AS t, 
            dbo.Correspondence  AS c, 
            dbo.CorrMeth  AS corr, 
            dbo.MailDocGrp  AS mdg
         WHERE 
            t.holdTypeID = 13 AND 
            t.holdId = c.holdId AND 
            c.corrMethId *= corr.corrMethID AND 
            c.mailDocGrpId = mdg.mailDocGrpID

Open in new window

Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Because you have aliased it, you need to use c to reference the table name

  dbo.Correspondence  AS c,
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rbhargaw

ASKER

Great!! That was fast..It resolved the issue..thanks a lot!!!
Thanks Again!