Disclaimer: I work in Synapse SQL team.
You can use code below to populate temp table #t with result set of sp_describe_first_result_set. Idea is to create temp table with the same columns as SP returns and then use INSERT INTO
CREATE TABLE #t (
is_hidden bit NOT NULL,
column_ordinal int NOT NULL,
name sysname NULL,
is_nullable bit NOT NULL,
system_type_id int NOT NULL,
system_type_name nvarchar(256) NULL,
max_length smallint NOT NULL,
precision tinyint NOT NULL,
scale tinyint NOT NULL,
collation_name sysname NULL,
user_type_id int NULL,
user_type_database sysname NULL,
user_type_schema sysname NULL,
user_type_name sysname NULL,
assembly_qualified_type_name nvarchar(4000),
xml_collection_id int NULL,
xml_collection_database sysname NULL,
xml_collection_schema sysname NULL,
xml_collection_name sysname NULL,
is_xml_document bit NOT NULL,
is_case_sensitive bit NOT NULL,
is_fixed_length_clr_type bit NOT NULL,
source_server nvarchar(128),
source_database nvarchar(128),
source_schema nvarchar(128),
source_table nvarchar(128),
source_column nvarchar(128),
is_identity_column bit NULL,
is_part_of_unique_key bit NULL,
is_updateable bit NULL,
is_computed_column bit NULL,
is_sparse_column_set bit NULL,
ordinal_in_order_by_list smallint NULL,
order_by_list_length smallint NULL,
order_by_is_descending smallint NULL,
tds_type_id int NOT NULL,
tds_length int NOT NULL,
tds_collation_id int NULL,
tds_collation_sort_id tinyint NULL
)
GO
INSERT INTO #t EXEC sp_describe_first_result_set N'
SELECT
*
FROM OPENROWSET(
BULK ''https://pandemicdatalake.blob.core.windows.net/public/curated/covid-19/ecdc_cases/latest/ecdc_cases.csv'',
FORMAT = ''CSV'',
PARSER_VERSION = ''2.0'') as [r]'
SELECT * FROM #t
INSERT
the result set from a call tosp_describe_first_result_set
. The article also goes further and uses the result set for additional processing.