2 Replies Latest reply: Oct 29, 2013 3:46 PM by Bill Markham RSS

    DIRECT DISCOVERY, SQL()  and stored procedures execution


      As you already know, DIRECT DISCOVERY allows to aggregate data at runtime using SQL-function in expressions. You can, for example, use following expression to find out maximux value for appropriate dimensions: SQL('MAX(some_column)'). But how about stored procedures execution? Something like this: SQL('EXEC MyStoredProcedure'). But such syntax is not allowed, i've go a message "Direct query failed" in my chart. After a while i've found solution and i would like to share idea here. Need to say, i've used MS SQL and following solution could be used with Microsoft SQL.

      Here you are:

      SQL('1 as Dummy; EXEC MyStoredProcedure; --')