Viewing 5 posts - 1 through 6 (of 6 total)
Seems like I have been unclear about my problem so I try to explain it differently.
I can write my procedure something like this :
CREATE PROCEDURE Test
@Param1...
January 30, 2008 at 6:53 am
I tried your last suggestion and it doesn't seem to be very efficient.
While using col3 = @Param1 gives me a cost of 2, the code (col3 = @Param1 OR @Param1...
January 30, 2008 at 6:19 am
Well if @Param1 contains a value, I want col3 to be tested against that value
col3 = @Param1
Otherwise i get col3 = col3 which is always true.
erb
January 30, 2008 at 3:33 am
Thanks for the response.
I want the clause
col3 = ISNULL(@Param1, col3)
to be always true if @Param1 is NULL
and
col4 = ISNULL(@Param2, col4)
to be always true if @Param2 is NULL.
If both @Param1...
January 30, 2008 at 3:04 am
Mistake, the sql should be
CREATE PROCEDURE Test
@Param1 AS INT = NULL,
@Param2 AS INT = NULL
AS
SET NOCOUNT ON
...
January 30, 2008 at 2:46 am
Viewing 5 posts - 1 through 6 (of 6 total)