Link to home
Start Free TrialLog in
Avatar of anthonytr
anthonytrFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Pass multiple INT in stored procedure

Hi,

I have taken over ownership of a SQL database with a number of Stored Procedures and i'm trying to work out how some of them work.  One of the SP has the following:

IF @Options & 1 = 1 EXEC Action_All @CompanyID
IF @Options & 2 = 2 EXEC FlowAll @CompanyD, @UserID, ''
IF @Options & 1 = 1 AND @Options & 2 = 2

Open in new window


When I execute the SP in the Management Studio I have 4 fields available one is the @Options.  

If I enter 1, the SP executes.  If I enter 2, the SP executes.  However I need to pass 1 & 2.  How do I do this?  I have tried passing:

1,2
1 & 2
'1,2'

Thanks
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

you got to pass 2 parameters here or else if still keep with one parameter, you need to compare with string value of '1,2', not '1' and '2'
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
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 anthonytr

ASKER

Thanks for the super clear response!