Revert "Revert "Sql server - if""

This reverts commit 08167db7b7d7641cf3a527736c627f9e62489387.