none
Is conditional compilation available for TSQL in SSDT?

    Question

  • Is there anything available in SSDT (Nov 2012) + VS2010 that allows conditional compilation of portions of TSQL code? I would love to be able to do something like this, as you can in C# or VB.NET:

    #IF DEBUG
        -- A bunch of useful PRINTs and what not
    #ELSE
        SET NOCOUNT ON
    #ENDIF
    
    #IF SS2012
        SET @pretty_date = FORMAT(@some_date, 'dddd, MMM dd, yyyy')
    #ELSE
        SET @pretty_date = CAST(@some_date AS nvarchar(12))
    #ENDIF


    jmh

    Tuesday, December 11, 2012 4:08 PM

Answers

All replies