reporting services - Issue with SSRS report with temp table -
to clear @ moment. not use stored procedure create temp table!
i new ssrs reports , trying complete large report. have multiple datasets using pretty same information in each. tried creating temp table in first dataset , in last dataset dropping table report not running. have questions.
say example have following
----------------- -------------- |data-set 1 |---------------------------|data source | |===============| | |============| |input | | |use single | |===============| | |transaction | |@mydate | | |enable | |@processorid | | |============| |===============| | |variables | | |===============| | |@startdate | | |@enddate | | |create #table | | |---------------| | |insert data | | |into #table | | |---------------| | |return dataset1| | |specific data. | | |===============| | | ----------------- | |data-set 2 |---------------| |===============| | |input | | |===============| | |@mydate | | |@processorid | | |===============| | |variables | | |===============| | |@startdate | | |@enddate | | |@larges$amount | | |---------------| | |using #table | | |return dataset2| | |specific data. | | |===============| | | ----------------- | |data-set 3 |---------------| |===============| |input | |===============| |@mydate | |@processorid | |===============| |variables | |===============| |@startdate | |@enddate | |@reasoncode | |@amount | |---------------| |using #table | |return dataset3| |specific data. | |---------------| |drop #table | |===============|
this how believed work without having use stored procedure. tell me if doing wrong?
doing other datas-ets error similar query execution failed data-set 'data-set2' invalid object name '#table'
so after research found out using #temp tables created in 1 data set cannot used in data set. , using ##tables not way go either cause kinds of issues when people try run report @ or near same time.
i able needed using stored procedure write data going use in other data sets staging table , before each run truncate table ("truncate table "). allow apply indexes , performance modifications needed.
once execute stored procedure in first data set. data populated in staging table , can call other data sets.
i hope helps trying use temp tables in other data sets. simple answer not possible.
Comments
Post a Comment