What is more efficiency: to do update with join or to do update with where.
Here is my code:
Join:
CREATE procedure [dbo].[MyProc]
@tvp myType readonly
as
update tb
set pp_update=CONVERT(date,GETDATE(),101)
from myTable tb
join @tvp t on t.crc32 = tb.pp_crc32
Where:
CREATE procedure [dbo].[MyProc]
@tvp myType readonly
as
update tb
set pp_update=CONVERT(date,GETDATE(),101)
from myTable tb
where t.crc32 = tb.pp_crc32
What is prefer? and if I have 2 terms can I use join??
I think you have a typo error at the second query. Maybe you mean
The two queries are the same. The only thing is that the first query is in
ANSI SQL-92syntax while the other one is theSQL-89(old one) syntax.