I'm been using Visual Studio conditional compilation based on the .Net Framework for many of my projects.
But now I'm encountering a need to conditionally compile in a Visual Studio SQL CLR project based on the selected target SQL Server version.
Is there a way to do that? I need a way to optionally include in the compiled DLL certain .sql files (stored procedures) and C# .cs files (SQL CLR stored procedures)
Thanks for your help!
Edit:
I found a solution for the .cs portion of the SQLCLR project. I followed the same steps for detecting .Net Framework as per this Stack Overflow question and then added to the VersionSpecificSymbols.Common.prop file lines like these:
<DefineConstants Condition="$(DSP.Contains('100')) == True">$(DefineConstants);SQL2008</DefineConstants>
I'm still looking for a way to "filter out" stored procedures based on SQL Server version