Re: Performance using coalesce()
From: Zach Wells (no_zwells_spam_at_ain1.com)
Date: 04/23/04
- Next message: ashleyT: "run exe frm cmdexec"
- Previous message: Tom Moreau: "Re: "evil" OR?"
- In reply to: Jacco Schalkwijk: "Re: Performance using coalesce()"
- Next in thread: Zach Wells: "Re: Performance using coalesce()"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Apr 2004 10:52:44 -0400
Jacco Schalkwijk wrote:
> The code you are looking for probably is:
>
> SELECT * FROM sometable
> WHERE @someparameter IS NULL OR @someparameter = someColumn
>
> Note that I use a (stored procedure) parameter, not a variable. Using
> variables ususally prevents the query optimizer from generating the optimal
> execution plan.
>
That's it, thanks! And, I really did mean a parameter, not a variable.
Zach
- Next message: ashleyT: "run exe frm cmdexec"
- Previous message: Tom Moreau: "Re: "evil" OR?"
- In reply to: Jacco Schalkwijk: "Re: Performance using coalesce()"
- Next in thread: Zach Wells: "Re: Performance using coalesce()"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|