Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A query is required.. urgent

Status
Not open for further replies.

dblaine

Technical User
Jul 28, 2002
36
CA
Hi folks,

I have two databases one is "dbs" other is "temp".

These have columns crf,publish,camp. These are in both the databases.
Now i want a query to update the publish coulumn and camp coulumn where the CRF of both the databases is same.
That is if CRF of Temp = CRF of DBS , then the respective values of Publish and Camp in the database temp should be update in the database of DBS.

Please this is very urgent, help me out.

TNX
Dblaine
 
do you mean that dbs and temp are both database tables not actual databases
I will assume you mean tables
Code:
UPDATE dbs
SET dbs.Publish = tmp.Publish,
    dbs.Camp = tmp.Camp
FROM temp tmp
WHERE tmp.CRF= dbs.CRF

if yuo mean databases, replace dbs and temp with dbs..mytable and temp with temp..mytable


"I'm living so far beyond my income that we may almost be said to be living apart
 
A sense of humility and gratitude often yields better results than one of entitlement or objectification.

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
esquared - is that a random quote, or is there a point?
Am i missing something ?

"I'm living so far beyond my income that we may almost be said to be living apart
 
it wasn't for your benefit, don't worry about it!!! :)

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
aha, i thought not, after reading through the posts again I understand now.

"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top