Skip to content

Instantly share code, notes, and snippets.

@ststeiger
Last active February 2, 2016 16:10
Show Gist options
  • Select an option

  • Save ststeiger/4c8dfb5d317f4799aa16 to your computer and use it in GitHub Desktop.

Select an option

Save ststeiger/4c8dfb5d317f4799aa16 to your computer and use it in GitHub Desktop.
SQL-SELECT from stored procedure
/*
exec sp_RPT_DATA_REM_Stundenuebersicht
@in_mandant=N'0'
,@in_sprache=N'de'
,@in_standort=N'8adddbda-442b-4de4-a89e-a4e863ad7a72'
,@in_gebaeude=N'00000000-0000-0000-0000-000000000000'
,@in_portofolio_raum=N'00000000-0000-0000-0000-000000000000'
,@in_subportofolio_raum=N'00000000-0000-0000-0000-000000000000'
,@in_strasse=N'Alle'
,@in_geschoss=N'00000000-0000-0000-0000-000000000000'
,@in_kehr=N'-99'
;
*/
sp_configure 'Show Advanced Options', 1
GO
RECONFIGURE
GO
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
-- http://stackoverflow.com/questions/653714/insert-results-of-a-stored-procedure-into-a-temporary-table
SELECT * INTO #MyTempTable FROM OPENROWSET('SQLNCLI', 'Server=VMSTZHDB08\SZH_DBH_1;Trusted_Connection=yes;',
'
EXEC HBD_CAFM_V3.dbo.sp_RPT_DATA_REM_Stundenuebersicht
@in_mandant=N''0''
,@in_sprache=N''de''
,@in_standort=N''8adddbda-442b-4de4-a89e-a4e863ad7a72''
,@in_gebaeude=N''00000000-0000-0000-0000-000000000000''
,@in_portofolio_raum=N''00000000-0000-0000-0000-000000000000''
,@in_subportofolio_raum=N''00000000-0000-0000-0000-000000000000''
,@in_strasse=N''Alle''
,@in_geschoss=N''00000000-0000-0000-0000-000000000000''
,@in_kehr=N''-99''
;
')
SELECT * FROM #MyTempTable
-- DROP TABLE #MyTempTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment