A simple request may not be possible, but I know there are some smart people :)
Given the boolean parameter, I want to define a where clause to either limit the specific output of the column or do nothing.
So, this @bit = 1 parameter will be the result:
where column = 1
given parameter @bit = 0, this will be the result:
where column = 1 or 0
i.e. do not affect / show all the results (the column is a bit).
I don't need dynamic sql β I can decide to fix this in the code, but I just wondered if there was any kind of smart magic that would make it more neat and simple.
Whether there is a? I am using sql server.
greetings: D
source share