0

I am converting some sql from Oracle to SQL Server 2017.

One of SQL code is having dbms_xplan.Display() inside the script.

I want to know what is the equivalent of dbms_xplan.Display() in SQL Server 2017.

1 Answer 1

2
SET STATISTICS XML ON;
GO
SELECT ... FROM ...;

This will produce a rowset with a clickable XML showplan:

enter image description here

Clicking on the XML will render a new tab with the graphical showplan. If you just want text output, instead of STATISTICS XML, use:

SET SHOWPLAN_TEXT ON;
GO
SELECT ... FROM ...;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.