Is conditional compilation available for TSQL in SSDT?
-
Tuesday, December 11, 2012 4:08 PM
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)) #ENDIFjmh
All Replies
-
Tuesday, December 11, 2012 7:04 PMModerator
SSDT does not support pre-processor directives to do conditional compilation.-GertD @ www.sqlproj.com
- Proposed As Answer by Janet YeildingMicrosoft Employee, Owner Wednesday, December 12, 2012 1:09 AM
- Marked As Answer by Janet YeildingMicrosoft Employee, Owner Thursday, December 13, 2012 5:38 PM
-
Tuesday, December 11, 2012 8:28 PMAny chance it will do in the future?
SSDT does not support pre-processor directives to do conditional compilation.
-GertD @ www.sqlproj.com
ObjectStorageHelper<T> – A WinRT utility for Windows 8 | http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me


