Hi all,
I am wondering if it is possible to get the execution plan of a query by using a SQL Script Task. I am have code similar to this running in the task:
SET SHOWPLAN_XML ON; GO SELECT 1 AS ABC GO SET SHOWPLAN_XML OFF;
I then need to find some way to get the result set. Because there is only one result set actually returned, I figured I could just do single row but that does not work.
Error: No result rowset is associated with the execution of this query.
So I throught maybe I need to go with full resulset.
[Execute SQL Task] Error: Executing the query "SET SHOWPLAN_XML ON;" failed with the following error: "No disconnected record set is available for the specified SQL statement.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Am I going to have to go Scripttask to work this out. SHOWPLAN has some stringent batch requirements that must be adhered to.