SQL implicit conversion error
Options
I have been running v5 and v6 side by side for a while now and v6 has been working with querying nicely, but when i tried running stored procedures today I was running into the following error:
SqlException: Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.
the sproc takes a varchar and an int, and I've been calling it like so:
sproc_name("12345", 67890)
in C# expression I've been highlighting the query and running it, and in v5 it works perfectly and v6 the error above.
is there something different about sprocs in v6?
thanks!
SqlException: Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.
the sproc takes a varchar and an int, and I've been calling it like so:
sproc_name("12345", 67890)
in C# expression I've been highlighting the query and running it, and in v5 it works perfectly and v6 the error above.
is there something different about sprocs in v6?
thanks!
Comments
-
Are you able to provide SQL to generate an SP that reproduces this problem?
-
Here is a sanitized example of the proc
USE[TestDb]
GO
/****** Object: StoredProcedure [dbo].[testproc] Script Date: 10/3/2019 8:57:38 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE[dbo].[testproc]
@vchCol varchar(100),
@intCol int
AS
SET NOCOUNT ON
DELETE
FROM dbo.testtable
WHERE varcol = @vchCol
AND intcol = @intCol
RETURN
Sql Server Version: Microsoft SQL Server 2005 - 9.00.5324.00 (X64) -
I'm still not getting an error. How is testable defined?
-
Suddenly it appears to be working. I don't know if something changed in my environment or anything, but the stored procedures seem to be working now.