Anyone having an answer on this:
Using hierarcical or shaped recordset using this syntax:
Does work, but has a puzzling side-effect in SQL Servers stored procedure:
queries, the T-SQL is something like this:
-- Do the detail query here
-- Do the no-detail query here
Guess what? The if statement is completely ignored when the sp is called
using the SHAPE syntax, that is the else part is always executed. When
command has to return a recordset.
Executing the same sp in the query window in SQL Server Enterprice Manager
gives all the expected results.