T-SQL problem with NULL

  • I have the following code:

    SELECT @OLD_VALUE = (SELECT NUMBER_OF_POS from deleted)

    SELECT @NEW_VALUE = (SELECT NUMBER_OF_POS from inserted)

    .

    .

    .

    .

    EXEC logEvent @BATCH_ID, @ACT, @TABLE_NAME, @COLUMN_NAME, @OLD_VALUE, @NEW_VALUE, @USER_ID

    When NUMBER_OF_POS is NULL in the deleted and inserted table, the EXEC logEvent fails.

    Is there a way to fix this?

    Thanks.

  • Ignore my question. It's Monday and I apparently did not get enough sleep.....

    Turns out that the table where I am logging to don't accept nulls 🙂

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply