anthonytr
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:
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
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the super clear response!