sql | SQL Server‎ > ‎sqlsrv | T-SQL‎ > ‎

tsql | sp_describe_first_result_set

select * into ttc from openrowset('sqlncli','server=.\node1;uid=sa;pwd=/''],lp123','SET NOCOUNT ON; SET FMTONLY OFF; exec sp_describe_first_result_set @tsql = N''SELECT 1''')

CREATE TABLE [dbo].[TTC](
[is_hidden] [bit] NOT NULL,
[column_ordinal] [int] NOT NULL,
[name] [nvarchar](128) NULL,
[is_nullable] [bit] NOT NULL,
[system_type_id] [int] NOT NULL,
[system_type_name] [nvarchar](128) NULL,
[max_length] [smallint] NOT NULL,
[precision] [tinyint] NOT NULL,
[scale] [tinyint] NOT NULL,
[collation_name] [nvarchar](128) NULL,
[user_type_id] [int] NULL,
[user_type_database] [nvarchar](128) NULL,
[user_type_schema] [nvarchar](128) NULL,
[user_type_name] [nvarchar](128) NULL,
[assembly_qualified_type_name] [nvarchar](4000) NULL,
[xml_collection_id] [int] NULL,
[xml_collection_database] [nvarchar](128) NULL,
[xml_collection_schema] [nvarchar](128) NULL,
[xml_collection_name] [nvarchar](128) 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) NULL,
[source_database] [nvarchar](128) NULL,
[source_schema] [nvarchar](128) NULL,
[source_table] [nvarchar](128) NULL,
[source_column] [nvarchar](128) NULL,
[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_is_descending] [bit] NULL,
[order_by_list_length] [smallint] NULL,
[tds_type_id] [int] NOT NULL,
[tds_length] [int] NOT NULL,
[tds_collation_id] [int] NULL,
[tds_collation_sort_id] [tinyint] NULL
) ON [PRIMARY
Comments