Hi

If the link is ID then your query looks ok the following will do it.....

UPDATE tableA
SET
region = TableB.region
FROM tableB, TableA
WHERE tableB.id = tableA.id

-----Original Message-----
From: Phillip B [mailto:[EMAIL PROTECTED]
Sent: 09 July 2003 17:40
To: CF-Talk
Subject: Re: update query 


That is what I would normally do but it has to be part of a DTS package and
will be ran everyday :(

Phillip B.

www.LoungeRoyale.com
www.FillWorks.com
----- Original Message -----
From: "Tony Weeg" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 11:25 AM
Subject: RE: update query


> I would do a cfquery of all columns in b.
>
> then loop through that, for each iteration, update
> a with the value of some b query column value.
>
> make sense?
>
> tony weeg
> uncertified advanced cold fusion developer
> tony at navtrak dot net
> www.navtrak.net
> office 410.548.2337
> fax 410.860.2337
>
>
> -----Original Message-----
> From: Phillip B [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 09, 2003 12:21 PM
> To: CF-Talk
> Subject: OT: update query
>
>
> I have two tables.
>
> tableA
> id
> name
> region
>
> tableB
> id
> name
> region
>
> I need to update tableA's region colum with tableB's region colum. The
> region colum has changed for some and not for others. With that said,
> does this look right?
>
> UPDATE
> tableA
> SET
> region = (SELECT region
> FROM
> tableB WHERE tableB.id = tableA.id)
>
>
> Its been a while since I have done this and I cant remeber the best way
> to do it. :|
>
> Phillip B.
>
> www.LoungeRoyale.com
> www.FillWorks.com
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to