I have a requirement where I want to pass multiple key values to select data from a table as below:
CREATE PROCEDURE a (@jobno varchar(100)) AS
select * from TabA where JobNo in (@jobno)
I cannot however pass in more than 1 key as it fails:
exec a '8002,8003'
Syntax error converting the varchar value '8002,8003' to a column of data type int.
How can I pass in multiple numeric values to be used in an 'IN' statement?
Thanks,
Dave.
CREATE PROCEDURE a (@jobno varchar(100)) AS
select * from TabA where JobNo in (@jobno)
I cannot however pass in more than 1 key as it fails:
exec a '8002,8003'
Syntax error converting the varchar value '8002,8003' to a column of data type int.
How can I pass in multiple numeric values to be used in an 'IN' statement?
Thanks,
Dave.