Forum Replies Created

Viewing 5 posts - 1 through 6 (of 6 total)

  • RE: Avoid repetitive code with ISNULL

    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...

  • RE: Avoid repetitive code with ISNULL

    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...

  • RE: Avoid repetitive code with ISNULL

    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

  • RE: Avoid repetitive code with ISNULL

    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...

  • RE: Avoid repetitive code with ISNULL

    Mistake, the sql should be

    CREATE PROCEDURE Test

    @Param1 AS INT = NULL,

    @Param2 AS INT = NULL

    AS

    SET NOCOUNT ON

    ...

Viewing 5 posts - 1 through 6 (of 6 total)