Illustration of MERGE in SQL Server 2008 MERGE Manufacturing.ProductInventory AS [pi]USING ( Decide upon ProductID,
Office 2010 Standard X86, SUM(OrderQty) AS OrderQty FROM Revenue.SalesOrderDetail AS sod Internal JOIN Income.SalesOrderHeader AS soh ON sod.SalesOrderID = soh.SalesOrderID Where by soh.OrderDate = GETDATE() GROUP BY ProductID ) AS src (ProductID,
Office Professional Plus, OrderQty) ON src.ProductID = [pi].ProductIDWHEN MATCHED AND src.OrderQty = 0 THEN DELETE; WHEN MATCHED THEN UPDATE SET [pi].Quantity = src.OrderQtyWHEN NOT MATCHED THEN INSERT VALUES (src.ProductID,
Microsoft Office 2010 Professional, src.OrderQty) Print | posted on Thursday,
Microsoft Office Home And Student 2010, September twenty,
Office Pro 2010 32 Bit, 2007 10:31 AM | Filed Underneath [ SQL Server 2008 ]