# ifdef type conditional compilation in T-SQL sql server 2008 2005 -



# ifdef type conditional compilation in T-SQL sql server 2008 2005 -

for sake of backwards compatibility need have stored proc run on both sql server 2005 , sql server 2008. due commands beingness deprecated in sql server 2008 script compiles on 2005 fails on 2008. looking c++, c# equivalent of #define, #ifdef can compile same script on 2005 & 2008. standard practice on ? attached screenshot explains in detail. give thanks you

use dynamic sql:

if (@returnval = 1) exec ('backup log mydb truncate_only');

sql-server sql-server-2005 tsql sql-server-2008

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -