Is this a legal strategy? It seems illegal.
if (select object_id('aTableName', 'u')) is not null begin
select column
from aTableName
where thisIsTrue = 1
and somethingIs in (select aList from aListTable)
and somethingElse = (
select aValue
from aValueTable
where aValue = 'somethingImportant'
)
end else begin
print('Oh noes! I couldn't find somethingImportant or something in someList form aTable!')
end
we work with huge amounts of data with systems and processes that don't lend themselves to other methods (yet... it's coming.) so we have to make SQL as readable as possible.