Oracle dbms_xplan.Display() equivalent to SQL Server 2017 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.
SET 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 ...;