Hi there,
I'm passing in a list of numbers a varchar (2,3,4,5,6) into a stored proc but he SQL needs to convert the list to an integer data type.
CREATE PROCEDURE my_proc
@strBranchIDs varchar(255)
AS
SELECT Users.UserID,
Users.OfficeID,
Users.UserInitials,
Users.FullName
FROM Users
WHERE Active = 1
AND OfficeID IN (convert(int,@strBranchIDs))
I get an error "Syntax error converting the varchar value '3,2,5,6,4' to a column of data type int"
How can I get around this? Thanks
Kev
Return
GO
I'm passing in a list of numbers a varchar (2,3,4,5,6) into a stored proc but he SQL needs to convert the list to an integer data type.
CREATE PROCEDURE my_proc
@strBranchIDs varchar(255)
AS
SELECT Users.UserID,
Users.OfficeID,
Users.UserInitials,
Users.FullName
FROM Users
WHERE Active = 1
AND OfficeID IN (convert(int,@strBranchIDs))
I get an error "Syntax error converting the varchar value '3,2,5,6,4' to a column of data type int"
How can I get around this? Thanks
Kev
Return
GO