Questions about SQL Server 2005 using temporary tables (Invalid object name #temptb) _mssql2005

Source: Internet
Author: User
When I recently made a report using SSRS 2005, when I called a data source with a temporary table, the system would make an error and would not be able to go to the next step of the wizard as follows:
There is a error in the query. Invalid object name ' #temptb '.

After research, think of the following three solutions:

1. Use table variables instead of temporary tables, which avoids the syntax error of SSRS 2005, the disadvantage is that if the amount of data processed is large, it takes up too much memory, and the report load time is too long.

2. Create a report using an SQL statement that does not contain a temporary table. After the creation succeeds, modifies the data source, replaces the SQL command or the stored procedure which contains the temporary table, then uses the SSRS 2005 to bring the grammar check function to the data source grammar detection also to be able to complain, but does not affect the report the save and the load. In order to test the report in a concurrent invocation, if the data in the temp table is confusing, I did a test to publish a report with a temporary table that needs to run for a while to be generated to the report server, and then open multiple Web pages to access the report at the same time, while the report is loaded, but the data remains independent. Test results show that SSRS 2005 calls temporary tables under concurrent conditions, the same as other programs calling temporary tables, and does not affect the final display results. Of course, the temporary table mentioned above refers to the local temporary table (beginning with #), and if it is a global temporary table (# #开头), the data in the global temporary table will be shared between the reports.

3. Upgrade the report to SSRS 2008, SSRS 2008 supports the use of temporary tables.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.