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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update Query Help

Author  Topic 

kirannatt
Yak Posting Veteran

66 Posts

Posted - 2006-08-30 : 17:47:25
HI all,

I have two tables a, b with same table structure, same data but with diffrent data in one column and I need to update that differnt column:

Column ID is pk of identity type in both tables: here is query which i came up with :

update a
set xmldata=b.xmlData
from a
inner join b
on
a.id=b.id

or

update a
set xmldata=b.xmlData
from a, b
where a.id=b.id

I can get the desired results with this query but i want to cover all the risk so making sure it is correct one. Also, I am geeting same results with two methods so wondering is there any diffrence bertween these two methods or i can use either one of them.

Gopi Nath Muluka
Starting Member

22 Posts

Posted - 2006-08-30 : 18:43:30
There is no difference between the two statements

Inner joins can be specified in either the FROM or WHERE clause without affecting the final result.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-08-30 : 19:03:15
That is true, but the best option is your first one since it is ANSI compliant.

Tara Kizer
Go to Top of Page

kirannatt
Yak Posting Veteran

66 Posts

Posted - 2006-08-31 : 10:29:09
I just started working in SQL . Can you huys explain me what is ANSI Complaint?
Go to Top of Page
   

- Advertisement -