Hi guys,
I have a weird problem - I wonder if someone could spare a second for me.
I am running a DELETE statement inside a T-SQL Stored Procedure (for my C# .NET application). It's as simple as they get.
DELETE
FROM groupPromotionR equests
WHERE groupPromotionR equestId = @requestId;
However, when I call ExecuteNonQuery () I always get back 0. I have tried...
SET NOCOUNT OFF;
...in all sorts of places inside the procedure, yet it still always returns 0. I am certain that one row will be deleted as I have ran the query inside Management Studio and it said that one row was affected, plus I have checked the table itself.
I am very familiar with this setup and have used it all over my application, but for some reason this time it just won't work. I've tried renaming the procedure, debugging the return value from ExecuteNonQuery () and rewriting the procedure but nothing appears to work.
Does anyone have any clues? Thanks for your time.
Chris
I have a weird problem - I wonder if someone could spare a second for me.
I am running a DELETE statement inside a T-SQL Stored Procedure (for my C# .NET application). It's as simple as they get.
DELETE
FROM groupPromotionR equests
WHERE groupPromotionR equestId = @requestId;
However, when I call ExecuteNonQuery () I always get back 0. I have tried...
SET NOCOUNT OFF;
...in all sorts of places inside the procedure, yet it still always returns 0. I am certain that one row will be deleted as I have ran the query inside Management Studio and it said that one row was affected, plus I have checked the table itself.
I am very familiar with this setup and have used it all over my application, but for some reason this time it just won't work. I've tried renaming the procedure, debugging the return value from ExecuteNonQuery () and rewriting the procedure but nothing appears to work.
Does anyone have any clues? Thanks for your time.
Chris
Comment