Utilizando una condición if en un SQL Server de inserción
Tengo la siguiente declaración en mi código
INSERT INTO #TProductSales (ProductID, StockQTY, ETA1)
VALUES (@ProductID, @StockQTY, @ETA1)
Quiero hacer algo como:
IF @ProductID exists THEN
UPDATE #TProductSales
ELSE
INSERT INTO #TProductSales
¿Hay alguna manera de hacer esto?