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.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communitySET STATISTICS XML ON;
GO
SELECT ... FROM ...;
This will produce a rowset with a clickable XML showplan:
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 ...;