• Florian Reischl (3/14/2009)


    Hi

    I'm using sql_variant alike Jeff stated for logging. I've got a usp_Log like this:

    CREATE PROCEDURE dbo.usp_Log

    @msg VARCHAR(4000),

    @p1 SQL_VARIANT = NULL,

    @p2 SQL_VARIANT = NULL,

    @p3 SQL_VARIANT = NULL,

    @p4 SQL_VARIANT = NULL,

    @p5 SQL_VARIANT = NULL,

    @p6 SQL_VARIANT = NULL,

    @p7 SQL_VARIANT = NULL,

    @p8 SQL_VARIANT = NULL,

    @p9 SQL_VARIANT = NULL

    AS

    -- ...

    So I can specify 0 to 9 place holders (%1 to %9) to be replaced with any information.

    Greets

    Flo

    You've probably hit on one of the only places I've ever used SQL_Variant... logging in EAV's/NVP's.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)