SQLTeam.com | Weblogs | Forums

Update using mutliple Table values functions

i jave a table with
id int ideneity
number varchar(50)
status int

and 2 Table values functions
each one return different numbers
table 1 :
123
564
125
table 2:
444
567
321

when i do updatei want to update the status based on the table it exist in
of it's table1 then status=1
if table 2 then status=2
currentl i do it in 2 differnt queries for example :

UPDATE S
SET S.Status = 1,
FROM [dbo].[Logs] S
WHERE EXISTS (select prefix from [dbo].[table1] () g where s.ToNumber like g.prefix+'%')