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
 Transact-SQL (2000)
 UPDATE Records

Author  Topic 

Maharisi
Starting Member

19 Posts

Posted - 2007-07-09 : 06:01:05
I have two tables.
First one.
ID, NUMBER
1 , 11
2 , 12
3 , 13

Second one.
OS_ID,
12 ,
12 ,
11 ,
13 ,

I need UPDATE SECOND TABLE attribute OS_ID to ID according to NUMBER
Second table should looks like

OS_ID
2,
2,
1,
3,

Thanks

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-07-09 : 06:17:28
Update T2 Set Os_ID = T1.ID From
Table1 T1 Inner Join Table2 T2
On T1.Number = T2.OS_ID

Chirag

http://www.chirikworld.com
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-09 : 09:41:34
Do you need to really update that table?
If it is for display you can simply select using JOIN

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -