摆脱临时表 [英] Get rid of temp tables

查看:99
本文介绍了摆脱临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我需要开发复杂的报告时,我通常会在其中使用临时表存储数据并构建报告。



现在我有更多超过1个用户,所以如果我创建临时表,那么多个用户将存储数据,因此,数据可能不匹配。



你还有其他想法吗?开发报告,除了使用临时表。

Every time when I need a complex report to develop, I normally used a temporary table store data in that and build the report.

Now I am having more than 1 user, so If i create a temp table then more than one user will store the data, so, then data may mismatch.

Do you have any other Idea to develop report except using temp tables.

推荐答案

除了使用临时表之外,您还有其他想法来开发报告吗?

随着共享的信息量和提出的问题,任何人都很难告诉你100%准确的替代方案。

首先,看看表值函数,看看是否对你有帮助。
Do you have any other Idea to develop report except using temp tables.
With the amount of information shared and the question asked, it would be difficult for anyone to tell you the 100% accurate alternative.
To start with, have a look at table valued function and see if that helps you.


Quote:

现在我有超过1个用户,所以如果我创建一个临时表,那么多个用户将存储数据,所以,然后数据可能不匹配。

Now I am having more than 1 user, so If i create a temp table then more than one user will store the data, so, then data may mismatch.

- 仅当您使用全局临时表(前缀##)时。如果您使用本地临时表(前缀为#),那么它们对每个用户都是私有的,因此数据不会不匹配。



有一个非常好的有关临时表和表变量的文章,请访问 https:// www .simple-talk.com / sql / t-sql-programming / temporary-tables-in-sql-server / [ ^ ]

- Only if you use global temporary tables (prefix ##). If you use local temporary tables (prefixed with #) then they are "private" to each user so the data will not "mismatch".

There is a very good article on temporary tables and table variables here https://www.simple-talk.com/sql/t-sql-programming/temporary-tables-in-sql-server/[^]


这篇关于摆脱临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆