July 31, 2018 at 1:21 pm
My delete procedure:
ALTER PROCEDURE [dbo].[uspDelete_Report]
@ReportIndex VARCHAR(100)
AS
July 31, 2018 at 1:42 pm
itmasterw 60042 - Tuesday, July 31, 2018 1:21 PMHi
I have a stored procedure that simply deletes a record for a given ID sent in.
This is sent in from a VB.Net application. The issue is that it does not delete the record; and does not give an error. I believe is that in the table the field called
REPORT_INDEX, is a Bigint but what is being sent in from the textbox is a string. As you can see below I tried cast, but that did not work. Or maybe it is something else.
Any ideas would be appreaciated
ThanksMy delete procedure:
ALTER PROCEDURE [dbo].[uspDelete_Report]
@ReportIndex VARCHAR(100)
ASBEGIN
DELETE [dbo].[Reports]
Where [REPORT_INDEX] = @ReportIndex --Cast(@ReportIndex as bigint)
If the VB.NET is calling the stored procedure with a string you can replicate the VB.NET call withEXEC [dbo].[uspDelete_Report] '1234'
to test the stored procedure directly on the database using SSMS.
SQL Server will do implicit conversion from a string to an integer providing the string can be converted to an integer.
Another thing to try would be nvarchar instead of varchar but it would be helpful if you could paste in the .NET code that calls the stored procedure to the question.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply