Wow, do you ever sleep? you're like a machine!!!
Just one last anomaly I think, and that is when I use your template on a column in the table that is declared as a bool, bActive and in the stored procedure I take a variable defined as a bit, @bActive (the reasoning for it being a bit definition is to do with nettiers), when I run my stored proc, for null values and value of 1 I get the disired results, however passing the @bActive a 0 returns everything and I would just like to return the rows which are False, what am I doing wrong?
Here is some code
Any ideas on why I'm not able to just retreive the rows that are false?
if I pass 1 to @bActive variable and get all the rows which are True, null and I get everything, but 0 I get everything too? that shouldn't be happenning should it?
Thanks
Davinski
Just one last anomaly I think, and that is when I use your template on a column in the table that is declared as a bool, bActive and in the stored procedure I take a variable defined as a bit, @bActive (the reasoning for it being a bit definition is to do with nettiers), when I run my stored proc, for null values and value of 1 I get the disired results, however passing the @bActive a 0 returns everything and I would just like to return the rows which are False, what am I doing wrong?
Here is some code
Code:
bActive is defined as a bool in the table definition. @bActive bit, select * from TestTable where bActive like case when isnull(@bActive,'') = '' then '%' else cast(@bActive AS char(20)) end
if I pass 1 to @bActive variable and get all the rows which are True, null and I get everything, but 0 I get everything too? that shouldn't be happenning should it?
Thanks
Davinski
Originally posted by iburyak
Comment