DECLARE @false bit = 0;
IF @false
xxxx;
In a stored procedure in SQL Server, if you declare a bit variable, set it to 0, and never change it, then when it's used in an IF, like IF @false
, will the compiler simply leave out those blocks of code, or will it always evaluate the Boolean expression and branch? The answer will determine whether all my debug logging code needs to be commented out for production.