sql - SQL Server 中的 Tempdb

标签 sql sql-server stored-procedures tempdb

问题是这样的:我有一个包装存储过程,其中包含一堆其他存储过程。它看起来像这样:

Wrapper:

  exec procedure1
  exec procedure2
  exec procedure3

每个过程都会创建一个在其中使用的临时表。问题是每次执行包装器时,我都用完了 tempDB 空间。

但是,在执行每个单独的存储过程时,它工作正常。

我的理解是临时表在存储过程完成后被删除。那么,为什么我的 tempDB 变满了?

编辑:

这是我遇到的错误。

1101 : Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

最佳答案

用完 tempdb 中的磁盘空间会导致 SQL Server 环境中断。可能有多种原因导致 tempdb 变满,例如长时间执行查询、在 tempdb 中抽取大量数据。您需要确定获取完整 tempdb 的原因。 您可以通过以下链接: https://msdn.microsoft.com/en-us/library/ms176029.aspx 这可能会帮助你。

关于sql - SQL Server 中的 Tempdb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49042098/

相关文章:

python - 多个插入语句失败 postgresql/psycopg2

.net - SQL Server - 将错误报告回 .NET

c# - 使用 TransactSQL 将字节数组转换为字符串

sql-server - 如何临时将系统管理员权限授予用户?

sql - 遇到错误 : table or view does not exist

sql - PostgreSQL:更新...缺少插入?

java - 使用查询更新对象外键

sql - 窗口函数/聚合函数/中断窗口

sql - Sql Select 查询中的多个日期范围

stored-procedures - 使用存储过程中的游标将表从一个表插入到另一个表