This just looks so odd to me:
delete from GearsDev.dbo.Products
from GearsDev.dbo.Products as C
inner join #Common as M
on M.item = C.ItemNumber
#Common is a temp table, but the rest of it makes no sense to me.
How can you have two from clauses?
As can be seen from the documentation of DELETE, it can take two
FROMclauses.The first
FROM:The second
FROM:So, the SQL will delete records from the
Productstable that have a matching item when it is joined with#common.This is equivalent (in meaning) to the following query: