Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Exception handling- select from a table that doesn't exist

$
0
0

Hello guys,

I have a lengthy and complex SP which is generating a dynamic table at run based on some logic. This table is being used in a SSRS Report.

Now data is not available on some parameter combination and in this case this dynamic table won't get created and  Report shows  'invalid table #temp'.

I want to handle it in such a way that even if no data exist and this table is not created, i should not get error that  table doesn't exist. It is failing my report.

Could anyone please suggest.

TRY   Drop table av   end try catch  end catch -  this work even if table doesn't exist

TRY select * from av End  try catch end catch  -- this doesn't work if table doesn't exist. 

Avhilash


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>