Update details
set details.a=a, details.b=b
where Id=10 select a,b from @userdefinedtabletype
Here id is unique for all the records
Update details
set details.a=a, details.b=b
where Id=10 select a,b from @userdefinedtabletype
Here id is unique for all the records
Since you have not provided much detail as to what either table has in it I am going to assume that your user defined table only has one row in it. Otherwise you will get the last values that are returned from the query.
So I would use a CROSS APPLY to do the update such as:
Update details
set details.a=t2.a, details.b=t2.b
from details t1
CROSS APPLY (select a,b from @userdefinedtabletype) t2
where t1.Id=10
If in fact these tables are related by an ID of some sort then you would probably want to do an INNER JOIN:
Update details
set details.a=t2.a, details.b=t2.b
from details t1
INNER JOIN @userdefinedtabletype t2 on t1.id = t2.id
where t1.Id=10