问题是这样的:我有一个包装存储过程,其中包含一堆其他存储过程。它看起来像这样:
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/