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
 losing it, completely.

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2013-09-20 : 12:06:22
I've done this hundreds of times and am losing my mind trying to see where i'm wrong here.

Two tables. Need to update table "clusters", field "ClusteredYes" with a value of 1 where the field "Clustered" in table "MainServerInfo" has a value of "yes". the Autoid field ties the two tables together. So, i'm using:


Use SQLinfo
go
update Clusters
set clusteredyes = 1
inner join clusters.autoid = mainserverinfo.autoid
and mainserverinfo.[clustered] = 'yes'

migraine overriding ability to think clearly.

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-09-20 : 12:19:28
Untested
update 
C
set
clusteredyes = 1
FROM
Clusters AS C
INNER JOIN
mainserverinfo
ON C.autoid = mainserverinfo.autoid
and mainserverinfo.[clustered] = 'yes'
Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2013-09-20 : 12:26:21
jeebus. thank you.
Go to Top of Page
   

- Advertisement -