So I have a proc that someone else wrote that has code like the following:
if 1 = 0
begin
select
cast(null as int) as case_id,
cast(null as int) as review_id,
end
--then a real select statement happens that matches the same pattern.
Now, HP exstream is somehow reading the top select statement when it executes the stored proc, even though it should never be called. If I add columns to the real result query without adding as empty column to this hidden query, it will not work (in HP exstream, in SQL server, the proc runs as one would expect).
Anyone have any idea on how this could be working? how could HP Exstream be reading this non executing code?