Sql server 临时表记录限制
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10084857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Temporary table record limit in Sql server
提问by user824910
Is there any limits for the record in the temporary table.. I have tried with 1.3 million records.. may be i have to deal with billions in the future as the application demands.. Is it possible? If i could know the limit of records.. i could try to split the records from source db and manage within the limit. Thanks in advance
临时表中的记录是否有任何限制..我已经尝试了 130 万条记录.. 可能我将来必须根据应用程序的需要处理数十亿条记录.. 可能吗?如果我可以知道记录的限制..我可以尝试从源数据库中拆分记录并在限制内进行管理。提前致谢
采纳答案by Lam Tran Duy
The differences between tempdb and any other database are minimal, especially when it comes to limits.
tempdb 与任何其他数据库之间的差异很小,尤其是在限制方面。
If you can store it in a user table, you can store it in a temporary table as well. It does not have to fit into RAM as the tempdb is stored on disk just like any other database (only with more aggressive caching and less logging).
如果您可以将其存储在用户表中,则也可以将其存储在临时表中。它不必适合 RAM,因为 tempdb 就像任何其他数据库一样存储在磁盘上(只有更积极的缓存和更少的日志记录)。
Source: http://msdn.microsoft.com/en-us/library/ms190768.aspx
回答by Mikael Eriksson
A temporary table is a table so this would apply: Maximum Capacity Specifications for SQL Server
临时表是一个表,因此适用:SQL Server 的最大容量规范
Rows per table
Limited by available storage
每表行数
受可用存储空间限制
回答by Alex_L
No, there is no records limit for temporary table (the limit is the disk space). But be careful, because temporary tables are physically created in tempdb database, and this database must be placed on the disk with appropriate size.
不,临时表没有记录限制(限制是磁盘空间)。但是要小心,因为临时表是物理创建在 tempdb 数据库中的,并且这个数据库必须放置在具有适当大小的磁盘上。
回答by T-Lo
Any table will run into the hard limit of 1000 maximum rows that can be inserted with a single T-SQL INSERT statement that uses a table value constructor.
任何表都将遇到最大 1000 行的硬限制,这些行可以通过使用表值构造函数的单个 T-SQL INSERT 语句插入。
The number of row value expressions in the INSERT statement exceeds
the maximum allowed number of 1000 row values.
回答by Branko Dimitrijevic
Temporary tables are stored in the tempdb Database, and can grow as long as tempdb itself can grow (i.e. until the disk is full).
临时表存储在 tempdb 数据库中,只要 tempdb 本身可以增长(即直到磁盘已满),临时表就可以增长。
回答by Pranay Rana
Till your server memory (i.e., disk) supports, there is no issue how many records you are pushing into the temp table.
在您的服务器内存(即磁盘)支持之前,您将多少条记录推入临时表是没有问题的。
I think there is no limit on the number of records you push in the temporary table.
我认为您在临时表中推送的记录数没有限制。