I am coding a Table-valued Function in MS SQL 2008 R2.
Is it possible for a partial string of an SQL statement, which is in the WHERE clause to wrap an IF construct?
WHERE MyTable.MyColumn = @MyVariable
AND (MyColumn2 = @MyVariable2)
ORDER BY MyTable.MyColumn DESC