May 8, 2015 at 10:38 am
Hi
I'm not sure what I am doing wrong I have a multi select parameter which work if I only choose one value
but I get Must declare the scalar variable "@None" when I choose more than one
here is a snipet of my code
ALTER PROCEDURE [dbo].[CASELOAD]
@Program NVARCHAR (MAX)
,@None VARCHAR (8000)
As
Select....
where ...
--AND
-- Table.Name
-- IN (@None)
Thanks
Joe
May 8, 2015 at 4:02 pm
jbalbo (5/8/2015)
HiI'm not sure what I am doing wrong I have a multi select parameter which work if I only choose one value
but I get Must declare the scalar variable "@None" when I choose more than one
here is a snipet of my code
ALTER PROCEDURE [dbo].[CASELOAD]
@Program NVARCHAR #MAX#
,@None VARCHAR #8000#
As
Select....
where ...
--AND
-- Table.Name
-- IN #@None#
Thanks
Joe
I am assuming you are passing in a comma delimited string in the @NONE parameter of your stored procedure. You need to do something like this:
...
where ...
--AND
-- Table.Name IN (select Item from dbo.DelimitedSplit8K(@None,','))
You can find the dbo.DelimitedSplit8K function under resources with this article: http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply