MSSQL - Stored Procedure error - Conversion failed when converting the varchar value 'Smith' to data type int.
Posted on 2007-07-25
Hi guys 'n gals,
I have a bit of a problem with my Stored Procedure...
I pass in a string, and search against a varchar, and for some reason it thinks I am trying to cast from varchar to int?
Here is my execution strings:
// throws an error
EXEC sp_Search 'Surname', 'Smith'
// works fine
EXEC sp_Search 'UID', '5'
Here is my error:
Conversion failed when converting the varchar value 'Smith' to data type int.
Here is my stored procedure:
CREATE PROCEDURE sp_Search
END = @Value
tblClients.UID = int(4)
tblClients.Surname = varchar(128)
Anybody able to help me out please?