Tidbits on software development, technology, and other geeky stuff

UPDATE table with JOIN

For some reason I sometimes get the syntax mixed up for UPDATEs with a JOIN.  Here is an example of the correct syntax.

UPDATE ct
SET ct.Is_VIP = 1
FROM Contacts as ct
INNER JOIN State as st on ct.State_ID = st.State_ID
WHERE st.State_Name = 'Texas'

Discuss on Twitter