Compare Page Revisions
« Older Revision - Back to Page History - Current Revision
sp_describe_first_result_set
@@SERVERNAME
EXEC master..sp_addlinkedserver @server = 'loopback', @srvproduct = '', @provider = 'SQLNCLI', @datasrc = @@SERVERNAME; EXEC master..sp_serveroption @server = 'loopback', @optname = 'DATA ACCESS', @optvalue = 'TRUE';
if object_id('tempdb..#tmp') is not null drop table #tmp go /* TODO: The following line is only an example. Replace 'exec [MyDatabase].[MySchema].[sp_MyStoredProc] 0,0,null' with your own stored procedure call, including parameter values */ select top 10 * into #tmp from openquery(loopback, 'exec [MyDatabase].[MySchema].[sp_MyStoredProc] 0,0,null') SELECT c.name ,[type] = t.name ,c.max_length ,c.[precision] ,c.scale ,c.is_nullable FROM tempdb.sys.columns AS c inner JOIN tempdb.sys.types AS t ON c.system_type_id = t.system_type_id AND c.user_type_id = t.user_type_id WHERE c.[object_id] = object_id('tempdb..#tmp')
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.