简体   繁体   中英

Run SSRS report based on temporary table

I am not sure if this is possible. I have an original data set that is approximately 1.5MM records. I want to do a number of things to this dataset in preparation to using it in a report with parameters. I am using SSRS and SQL Server 2008 R2.

What I was thinking of doing is creating a temp table #XYZ that would have a subset of the original 1.5MM records and would have the additional fields I need for reporting.

I can do all of that in a stored procedure. Can I use that temp table without copying it to a table in the db.

Just so you understand, two people may want to query the data at approximately the same time and I do not want to have conflicts with dropping or updating tables.

A temporary table is unique to a connection/session and gets dropped when the proc ends. If you run the same proc from two different windows in SSMS each connection gets its own temporary table, you won't have a problem...unless you use a global temporary table with two pound signs ##XYZ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM