I want to check the estimated number of rows of a query in MS SQL Server. I can right click on the query and select "display estimated execution plan". but I want to do the exact thing with a hard code query. Is there any way to do this without using the GUI?
set showplan_xml on; go Your query; go set showplan_xml off; go
This will give the XML, and you should be able to see the Estimates in there.
Use the DMV query:
select row_count from sys.dm_exec_requests when your hard coded query is being run. You can also filter by session_id.