I have a stored procedure and I'm trying to debug it in the query window... when I open the stored procedure, I set some breakpoints in the code, but they never get hit.. In the code below, I can step through the USE line, then set ANSI_NULLS ON and then the code just says commands executed successfully, even though I have breakpoints set all throughout the code below it. Am I missing something?!
USE [Tool1]
GO
/****** Object: StoredProcedure [dbo].[aspdnsf_ImportProductPricing_XML] Script Date: 10/02/2014 09:38:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter proc [dbo].[aspdnsf_ImportProductPricing_XML]
@pricing ntext
AS
BEGIN
SET NOCOUNT ON
CREATE TABLE #tmp (ProductID int, VariantID int, KitItemID int, Name nvarchar(400), KitGroup nvarchar(800), SKU nvarchar(50), SKUSuffix nvarchar(50), ManufacturerPartNumber nvarchar(50), Cost money, MSRP money, Price money, SalePrice money, Inventory int)
DECLARE @hdoc int, @retcode int
EXEC @retcode = sp_xml_preparedocument
@hdoc OUTPUT,
@pricing
INSERT #tmp
SELECT *
FROM OPENXML(@hdoc, '/productlist/productvariant', 2)
WITH (ProductID int, VariantID int, KitItemID int, Name nvarchar(400), KitGroup nvarchar(800), SKU nvarchar(50), SKUSuffix nvarchar(50), ManufacturerPartNumber nvarchar(50), Cost money, MSRP money, Price money, SalePrice money, Inventory int)
UPDATE dbo.ProductVariant
SET Price = t.Price,
SalePrice = nullif(t.SalePrice,0),
Inventory = t.Inventory,
Cost = t.cost
FROM dbo.ProductVariant p
join #tmp t on p.ProductID = t.ProductID and p.VariantID = t.VariantID
WHERE KitItemID = 0
UPDATE dbo.KitItem
SET PriceDelta = t.Price
FROM dbo.KitItem k
join #tmp t on k.KitItemID = t.KitItemID
WHERE t.KitItemID > 0
exec sp_xml_removedocument @hdoc
DROP TABLE #tmp
END
PRINTandSELECT?