使用 SQL Server 临时表

发布于 2024-11-10 18:14:39 字数 463 浏览 3 评论 0原文

我正在重写一个使用大量临时表的 Access 应用程序。这意味着数据被添加到表中、进行修改、用于其他表中的更新,然后数据被删除。我试图弄清楚当我将其移至 SQL Server 时,使用暂存/临时表或存储在本地内存中的表的类似过程是否是更好的做法。

有没有首选方法?

编辑:

根据额外信息的请求。目前的流程基本上是上午的流程。

Table1 data moves to Table2 (temp)
Table1 data is deleted
Table1 gets new data for the day
Table2 gets a few updates
Table2 is then used to update Table1
Table2 data is deleted.

正如我所说,当前进程在设计糟糕的 Access DB 中运行,因此我们正在针对 SQL Server 重新设计它。

I am rewriting an Access application that uses a lot of Temp tables. Meaning the data gets added to the table, massaged, used for updates in other tables and then the data is deleted. I am trying to figure out when I move this to SQL server if it is better practice to use a similar process of a staging/temp table or a table that gets stored in local memory.

Is there a preferred method for this?

EDIT:

Per a request for additional info. The current process basically is in a morning process.

Table1 data moves to Table2 (temp)
Table1 data is deleted
Table1 gets new data for the day
Table2 gets a few updates
Table2 is then used to update Table1
Table2 data is deleted.

As I said this current process runs in an Access DB that is horribly designed so we are redesigning it for SQL server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紧拥背影 2024-11-17 18:14:39

这是“视情况而定”的情况之一。总的来说,如果有多个用户(或自动化源)同时运行使用“临时表方法”的进程,那么最好使用临时表,因为每个实例都会有自己唯一的一组(一个或多个)更多)临时表。然而,如果这样的过程只有一个实例,那么拥有一组“固定”的永久暂存表来执行工作是有意义的。

This is one of those "it depends" situations. By and large, if there will be multiple users (or automated sources) concurrently running a process that uses a "temp table methodology", you are better off using temp tables, as then each instance will have its own unique set of (one or more) temp tables. However, if there will only ever be one instance of such a process, it can make sense to have a "fixed" set of permanent staging tables within which to do the work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文