-6

[Here i have 10 checkbox, now I want that if my client select any of this and any number of checkbox selected then Report will Generate and in this coding also I want to use StoredProcedure, now if I go with coding individualy for all Possibilities I have to write 99 StoredProcedure and 99 times Coding, So is there any easy Possible way for this Problem..?? ]

enter image description here

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
Deep Patel
  • 45
  • 1
  • 8
  • Can you explain your issue in more detail? As it stands, it's very unclear what's being asked. – Adrian Wragg Mar 13 '14 at 11:32
  • 1
    Creating a single SP and passing the checkbox value as a parameter? – samar Mar 13 '14 at 11:32
  • Yaa, exactly Samar, in brief if I select checkbox of H.T., Unit and OEM then also result will get and IF I select Stor H.T., Unit and Assembly then also result will get this both things i want in single Query and single coding..... and same for the all other possibilities – Deep Patel Mar 13 '14 at 11:39
  • Adrian Wragg, I am very sorry, I know, I can't explain it properly because of Language bearer – Deep Patel Mar 13 '14 at 11:40
  • Code! Show us some code! We all understand this universal language here! – RandomSeed Mar 13 '14 at 12:51

2 Answers2

0

I think you can try Table-Valued parameter. Or you might get some ideas from this post. T-SQL stored procedure that accepts multiple Id values

Community
  • 1
  • 1
0

Which database are you using? SQL Server 2008 or higher? If yes then the answer by @user3353613 will be useful. If not then you can pass comma/pipe(|) separated checkbox values to a single parameter to your stored procedure and then you can split the values inside the stored procedure to get what you need.

Hope this helps.

samar
  • 5,021
  • 9
  • 47
  • 71