Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 UPDATE Using Multiple Tables

Author  Topic 

seanmt
Starting Member

7 Posts

Posted - 2010-05-12 : 13:15:51
I'm having problems updating values in one table depending if the member id exists in another table

My current SQL code is:

UPDATE etl_Members
SET
m.IsaLibrarian = 1
FROM
[dbo].[etl_Members] m,
[dbo].[Librarians] l
WHERE
m.MemberID = l.MemberID


But when I run it I get...

The multi-part identifier "m.IsaLibrarian" could not be bound.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-12 : 13:17:45
Begin with:
UPDATE m


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

seanmt
Starting Member

7 Posts

Posted - 2010-05-12 : 13:19:25
Doh how stupid of me. Thanks for the quick response.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-12 : 13:26:32
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -