Link to home
Start Free TrialLog in
Avatar of danielolorenz
danielolorenz

asked on

How Do You Pass In Multiselect Parameters Into a Stored Procedure?

How Do You Pass In Multi-select parameters into a Stored Procedure?  

I need the results to be in a @LOB_KEY

the code:
		HAVING 	CLAIM_LAST_STATUS IN (@CLAIM_STATUS) 
			AND LOB_KEY IN (@LOB_KEY) 
			AND POLICY_YR IN (@POLICY_YR)

Open in new window


The @LOB_KEY needs to be passed in and partitioned into multiple values:
HAVING IN (value1, value2 etc..) CLAUSE

Any advice on a solution is appreciated.

Dan
SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of danielolorenz
danielolorenz

ASKER

Here is my code:

declare @names varchar(200);

set @names = 'Dan, Dirk';

SELECT TOP 1000 [USER_KEY]
      ,[SECURITY_ID]
      ,[USER_FIRST_NM]
      ,[USER_LAST_NM]
      ,[USER_EMAIL]
      ,[ACTIVE_IND]
  FROM [BRAC_Portal].[dbo].[PORTAL_USER]
  where [USER_FIRST_NM] IN ('' + @names + '')

Open in new window


How do you get this code to work?  What is the best syntax?

Dan
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Excellent help.  Thanks.