siggemannen Thanks for the help.
I used sys.dm_exec_describe_first_result_set to get result set details. Here is the query:
DECLARE @Query nvarchar(max)= N'' SELECT * FROM sys.dm_exec_describe_first_result_set(@Query,NULL,0)