December 11, 2002 at 5:09 pm
I have a query that has to update a table in DB1 with criteria (where clause) from DB2.tablename. I keep getting syntax errors with my query but nothing is helping me. I know this is simple but I can't quite get it.
UPDATE mytable
SET field1 = db2.tablename.field1
where db2.tablename.field2 = 'US_CITIES'
and state_county_fips_cd not like '02%'
and state_county_fips_cd not like '15%'
December 11, 2002 at 8:34 pm
update U
set <your fields go here>
from TableToUpdate U
join TableInOtherDatabase O
on U.KeyField = o.KeyField
December 12, 2002 at 6:27 am
Nice one Don, did'nt know could do it that way. I always did
update TableToUpdate
set <your fields go here>
from TableToUpdate u
join TableInOtherDatabase o
on u.KeyField = o.KeyField
Far away is close at hand in the images of elsewhere.
Anon.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy