Re: Where statement with variables
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 01/31/05
- Next message: Phil: "Index's"
- Previous message: Phil: "Where statement with variables"
- In reply to: Phil: "Where statement with variables"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 31 Jan 2005 10:45:43 +0100
On Mon, 31 Jan 2005 01:21:02 -0800, Phil wrote:
>Just a quick question for anyone, I have a stored procedure that uses a lot
>of variables in a where statement, the only problem with this is it's very
>slow, I am just listing them something like this
>
>WHERE
>AND (tblSurvey.disposal_method = @disposalRoute OR @disposalRoute = 'null')
>AND (tblSurvey.air_conditioning = @airCon OR @airCon = 'null')
>AND (tblSurvey.documentation = @documentation OR @documentation = 'null')
>
>is there a better way of writting this statement to speed it up.
Hi Phil,
A lengthy explanation about different ways to skin this cat can be found
in Erlands article:
http://www.sommarskog.se/dyn-search.html
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Phil: "Index's"
- Previous message: Phil: "Where statement with variables"
- In reply to: Phil: "Where statement with variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|