My Photo

Consulting/Training

Speaking engagement

January 2007

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

My Online Status

Disclaimer

  • No Warranty..
    I have taken care in writing the articles on this blog and make no implied or expressed warranty of any sort. For any errors or omissions, I will not be responsible in any way.

« SSIS: stored proc and ado.net | Main | c#: using reflection for parameters list »

December 17, 2006

Comments

test

You could do the entire thing using the IsNull function instead of coalesce

Lukas Holota

thanks, exacktly the idea I was looking for, you saved my ass :)

Abhishek

Thanks man...Using Case is an excellent option.

qwkmz fgxwsv

ofiev rqgpswcft kupjhtqwa ldsknzf gmpzjbo wyvz eftsjhpuv

rg

What about:

...
and (t.pcustid = @custid or @custid = -1)
...

If you pass -1 to @custid, all customers would be returned.

pavel

there is also
select * from mytable
where
(@i IS NULL or mycol = @i)

pavel

oops didn't see prev comment.. sorry

Jawahar Rajan

This is a great idea, how ever i get stuck when I am using uniqueidentifier as a column type because
I cannot use integers

texas hold em online

Do you like to play poker? If so, you probably get together with your friends a couple times a week in order to compete. Even though this can be a lot of fun, it may not allow you to get your fill

The comments to this entry are closed.