SQL Server 的最大容量規格Maximum Capacity Specifications for SQL Server

如需舊版的 SQL Server 相關的內容,請參閱Maximum Capacity Specifications for SQL ServerFor content related to previous versions of SQL Server, see Maximum Capacity Specifications for SQL Server.

下表指定 SQL ServerSQL Server 元件中已定義之各種物件的大小和數目上限。The following tables specify maximum sizes and numbers of various objects defined in SQL ServerSQL Server components. 若要導覽至 SQL ServerSQL Server 技術的資料表,請按一下其連結:To navigate to the table for a SQL ServerSQL Server technology, click on its link:

SQL Server Database Engine 物件SQL Server Database Engine Objects

SQL Server 公用程式物件SQL Server Utility Objects

SQL Server 資料層應用程式物件SQL Server Data-tier Application Objects

SQL Server 複寫物件SQL Server Replication Objects

Database EngineDatabase Engine 物件 Database EngineDatabase Engine Objects

SQL ServerSQL Server 資料庫中已定義或 Transact-SQLTransact-SQL 陳述式中所參考之各種物件的大小和數目上限。Maximum sizes and numbers of various objects defined in SQL ServerSQL Server databases or referenced in Transact-SQLTransact-SQL statements.

SQL ServerSQL Server Database EngineDatabase Engine 物件 (object) object 大小/數目上限 SQL ServerSQL Server (64 位元)Maximum sizes/numbers SQL ServerSQL Server (64-bit) 其他資訊Additional Information
批次大小Batch size 65,536 * 網路封包大小65,536 * Network Packet Size 網路封包大小是表格式資料流 (TDS) 封包的大小,這些封包用於應用程式與關聯式 Database EngineDatabase Engine之間的通訊。Network Packet Size is the size of the tabular data stream (TDS) packets used to communicate between applications and the relational Database EngineDatabase Engine. 預設封包大小是 4 KB,由 network packet size 組態選項所控制。The default packet size is 4 KB, and is controlled by the network packet size configuration option.
每個短字串資料行的位元組數Bytes per short string column 8,0008,000
每個 GROUP BY、ORDER BY 的位元組數Bytes per GROUP BY, ORDER BY 8,0608,060
每個索引鍵的位元組數Bytes per index key 叢集索引為 900 個位元組數。900 bytes for a clustered index. 非叢集索引為 1,700。1,700 for a nonclustered index. SQL ServerSQL Server中,叢集索引鍵的最大位元組數不得超過 900。The maximum number of bytes in a clustered index key cannot exceed 900 in SQL ServerSQL Server. 非叢集索引鍵的最大位元組數為 1700。For a nonclustered index key, the maximum is 1700 bytes.

您可以使用大小上限增加超過限制的可變長度資料行,來定義索引鍵。You can define a key using variable-length columns whose maximum sizes add up to more than the limit. 不過,這些資料行中的資料大小總和不得超過限制。However, the combined sizes of the data in those columns can never exceed the limit.

在非叢集索引中,您可以包含額外的非索引鍵資料行,這些資料行不會計入索引鍵的大小限制。In a nonclustered index, you can include extra non-key columns, and they do not count against the size limit of the key. 非索引鍵資料行可能有助於提升某些查詢的執行效能。The non-key columns might help some queries perform better.
記憶體最佳化資料表之每個索引鍵的位元組數Bytes per index key for memory-optimized tables 非叢集索引為 2500 個位元組。2500 bytes for a nonclustered index. 只要所有索引鍵都能納入資料列,雜湊索引便沒有限制。No limit for a hash index, as long as all index keys fit in-row. 在記憶體最佳化資料表中,非叢集索引不能有宣告大小上限超過 2500 個位元組的索引鍵資料行。On a memory-optimized table, a nonclustered index cannot have key columns whose maximum declared sizes exceed 2500 bytes. 索引鍵資料行中的實際資料是否小於宣告大小上限則與此無關。It is irrelevant whether the actual data in the key columns would be shorter than the maximum declared sizes.

雜湊索引鍵的大小沒有固定限制。For a hash index key there is no hard limit on size.

記憶體最佳化資料表上的索引沒有內含資料行的概念,因為所有索引本來就涵蓋所有資料行。For indexes on memory-optimized tables, there is no concept of included columns, since all indexes inherently cover of all columns.

至於記憶體最佳化資料表,即使資料列大小為 8060 個位元組,某些可變長度資料行實際可儲存的大小超過 8060 個位元組。For a memory-optimized table, even though the row size is 8060 bytes, some variable-length columns can be physically stored outside those 8060 bytes. 不過,資料表上所有索引之所有索引鍵資料行的宣告大小上限,加上資料表中任何其他的固定長度資料行,必須符合 8060 個位元組。However, the maximum declared sizes of all key columns for all indexes on a table, plus any additional fixed-length columns in the table, must fit in the 8060 bytes.
每個外部索引鍵的位元組數Bytes per foreign key 900900
每個主索引鍵的位元組Bytes per primary key 900900
每個資料列的位元組數Bytes per row 8,0608,060 SQL ServerSQL Server 支援資料列溢位儲存,好讓可變長度資料行可以非資料列形式推送。 supports row-overflow storage which enables variable length columns to be pushed off-row. 只有 24 位元組的根會儲存在從資料列發送之可變長度資料行的主要記錄中;因此,有效資料列限制高於舊版 SQL ServerSQL ServerOnly a 24-byte root is stored in the main record for variable length columns pushed out of row; because of this, the effective row limit is higher than in previous releases of SQL ServerSQL Server. 如需詳細資訊,請參閱《 SQL ServerSQL Server 線上叢書》中的<超過 8 KB 的資料列溢位資料>主題。For more information, see the "Row-Overflow Data Exceeding 8 KB" topic in SQL ServerSQL Server Books Online.
記憶體最佳化資料表中每個資料列的位元組數Bytes per row in memory-optimized tables 8,0608,060 SQL Server 2016SQL Server 2016 開始,記憶體最佳化資料表支援非資料列儲存。Starting SQL Server 2016SQL Server 2016 memory-optimized tables support off-row storage. 如果資料表中所有資料行的大小上限超過 8060 個位元組,則會以非資料列形式推送可變長度資料行;這是編譯時期決策。Variable length columns are pushed off-row if the maximum sizes for all the columns in the table exceeds 8060 bytes; this is a compile-time decision. 針對以非資料列形式儲存的資料行,只會以非資料列形式儲存 8 位元組參考。Only an 8-byte reference is stored in-row for columns stored off-row. 如需詳細資訊,請參閱 記憶體最佳化資料表中的資料表和資料列大小For more information, see Table and Row Size in Memory-Optimized Tables.
預存程序之來源文字的位元組數Bytes in source text of a stored procedure 批次大小或 250 MB 當中較小者Lesser of batch size or 250 MB
每個 varchar(max)varbinary(max)xmltextimage 資料行的位元組數Bytes per varchar(max), varbinary(max), xml, text, or image column 2^31-12^31-1
每個 ntextnvarchar(max) 資料行的字元數Characters per ntext or nvarchar(max) column 2^30-12^30-1
每份資料表的叢集索引數Clustered indexes per table 11
GROUP BY、ORDER BY 的資料行Columns in GROUP BY, ORDER BY 僅受限於位元組數Limited only by number of bytes
GROUP BY WITH CUBE 或 WITH ROLLUP 陳述式中的資料行或運算式Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement 1010
每個索引鍵的資料行數Columns per index key 3232 如果資料表包含一或多個 XML 索引,則使用者資料表的叢集索引鍵限制為 31 個資料行,因為 XML 資料行會加入主要 XML 索引的叢集索引鍵中。If the table contains one or more XML indexes, the clustering key of the user table is limited to 31 columns because the XML column is added to the clustering key of the primary XML index. SQL ServerSQL Server中,您可以在非叢集索引中包含非索引鍵資料行,以避免達到最多 32 個索引鍵資料行的限制。In SQL ServerSQL Server, you can include nonkey columns in a nonclustered index to avoid the limitation of a maximum of 32 key columns. 如需詳細資訊,請參閱 建立內含資料行的索引For more information, see Create Indexes with Included Columns.
每個外部索引鍵的資料行數Columns per foreign key 3232
每個主索引鍵的資料行數Columns per primary key 3232
每個非寬型資料表的資料行數Columns per nonwide table 1,0241,024
每個寬型資料表的資料行數Columns per wide table 30,00030,000
每個 SELECT 陳述式的資料行數Columns per SELECT statement 4,0964,096
每個 INSERT 陳述式的資料行數Columns per INSERT statement 40964096
每個用戶端的連接數目Connections per client 已設定之連接的最大值Maximum value of configured connections
資料庫大小Database size 524,272 TB524,272 terabytes
每個 SQL ServerSQL ServerDatabases per instance of SQL ServerSQL Server 32,76732,767
每個資料庫的檔案群組數Filegroups per database 32,76732,767
記憶體最佳化資料的每個資料庫檔案群組Filegroups per database for memory-optimized data 11
每個資料庫的檔案數Files per database 32,76732,767
檔案大小 (資料)File size (data) 16 TB16 terabytes
檔案大小 (記錄檔)File size (log) 2 TB2 terabytes
每個資料庫之記憶體最佳化資料的資料檔案Data files for memory-optimized data per database 4.0964.096
記憶體最佳化資料之每個資料檔案的差異檔案Delta file per data file for memory-optimized data 11
每個資料表的外部索引鍵資料表參考數Foreign key table references per table 外寄 = 253。Outgoing = 253. 內送 = 10,000。Incoming = 10,000. 相關限制,請參閱 Create Foreign Key RelationshipsFor restrictions, see Create Foreign Key Relationships.
識別碼長度 (字元數)Identifier length (in characters) 128128
每部電腦的執行個體數Instances per computer 單機伺服器為 50 個執行個體。50 instances on a stand-alone server.

當使用共用叢集磁碟做為叢集安裝的預存選項時,在容錯移轉叢集上可支援 25 個執行個體,若您選擇 SMB 檔案共用為叢集安裝的儲存選項, SQL ServerSQL Server 則可在容錯移轉叢集上支援 50 個執行個體。25 instances on a failover cluster when using a shared cluster disk as the stored option for you cluster installation SQL ServerSQL Server supports 50 instances on a failover cluster if you choose SMB file shares as the storage option for your cluster installation.
每個記憶體最佳化資料表的索引Indexes per memory-optimized table 88
包含 SQL 陳述式的字串長度 (批次大小)Length of a string containing SQL statements (batch size) 65,536 * 網路封包大小65,536 * Network packet size 網路封包大小是表格式資料流 (TDS) 封包的大小,這些封包用於應用程式與關聯式 Database EngineDatabase Engine之間的通訊。Network Packet Size is the size of the tabular data stream (TDS) packets used to communicate between applications and the relational Database EngineDatabase Engine. 預設封包大小是 4 KB,由 network packet size 組態選項所控制。The default packet size is 4 KB, and is controlled by the network packet size configuration option.
每個連接的鎖定數Locks per connection 每部伺服器的最大鎖定數Maximum locks per server
每個 SQL ServerSQL ServerLocks per instance of SQL ServerSQL Server 僅受限於記憶體Limited only by memory 這個值是針對靜態鎖定配置。This value is for static lock allocation. 動態鎖定僅受限於記憶體。Dynamic locks are limited only by memory.
巢狀預存程序層級Nested stored procedure levels 3232 如果預存程序存取超過 64 個資料庫或以交錯方式超過 2 個資料庫,您會收到錯誤訊息。If a stored procedure accesses more than 64 databases, or more than 2 databases in interleaving, you will receive an error.
巢狀子查詢Nested subqueries 3232
巢狀觸發程序層級Nested trigger levels 3232
每份資料表的非叢集索引數Nonclustered indexes per table 999999
當下列任何一個存在時,GROUP BY 子句內相異運算式的數目:CUBE、ROLLUP、GROUPING SETS、WITH CUBE、WITH ROLLUPNumber of distinct expressions in the GROUP BY clause when any of the following are present: CUBE, ROLLUP, GROUPING SETS, WITH CUBE, WITH ROLLUP 3232
GROUP BY 子句中由運算子產生的群組集合數目Number of grouping sets generated by operators in the GROUP BY clause 4,0964,096
每個預存程序的參數數目Parameters per stored procedure 2,1002,100
每個使用者定義函數的參數數目Parameters per user-defined function 2,1002,100
每份資料表的 REFERENCESREFERENCES per table 253253
每份資料表的資料列數Rows per table 受限於可用的儲存體Limited by available storage
每個資料庫的資料表數Tables per database 受限於資料庫的物件數Limited by number of objects in a database 資料庫物件包含像資料表、檢視、預存程序、使用者定義函數、觸發程序、規則、預設值和條件約束等物件。Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. 資料庫中所有物件數的總和不得超過 2,147,483,647。The sum of the number of all objects in a database cannot exceed 2,147,483,647.
每份分割區資料表或索引的分割區數Partitions per partitioned table or index 15,00015,000
非索引資料行的統計資料Statistics on non-indexed columns 30,00030,000
每個 SELECT 陳述式的資料表數Tables per SELECT statement 僅受限於可用的資源Limited only by available resources
每份資料表的觸發程序數Triggers per table 受限於資料庫的物件數Limited by number of objects in a database 資料庫物件包含像資料表、檢視、預存程序、使用者定義函數、觸發程序、規則、預設值和條件約束等物件。Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. 資料庫中所有物件數的總和不得超過 2,147,483,647。The sum of the number of all objects in a database cannot exceed 2,147,483,647.
每個 UPDATE 陳述式 (寬型資料表) 的資料行數Columns per UPDATE statement (Wide Tables) 40964096
使用者連線User connections 32,76732,767
XML 索引XML indexes 249249

SQL ServerSQL Server 公用程式物件 SQL ServerSQL Server Utility Objects

SQL ServerSQL Server 公用程式中測試之各種物件的大小和數目上限。Maximum sizes and numbers of various objects that were tested in the SQL ServerSQL Server Utility.

SQL ServerSQL Server 公用程式物件 Utility object 大小/數目上限 SQL ServerSQL Server (64 位元)Maximum sizes/numbers SQL ServerSQL Server (64-bit)
每個 SQL ServerSQL Server 公用程式的電腦數 (實體電腦或虛擬機器)Computers (physical computers or virtual machines) per SQL ServerSQL Server Utility 100100
每部電腦的 SQL ServerSQL Server 執行個體數Instances of SQL ServerSQL Server per computer 55
每個 SQL ServerSQL Server 公用程式的 SQL ServerSQL Server 執行個體總數Total number of instances of SQL ServerSQL Server per SQL ServerSQL Server Utility 200200
每個 SQL ServerSQL Server執行個體的使用者資料庫數,包括資料層應用程式User databases per instance of SQL ServerSQL Server, including data-tier applications 5050
每個 SQL ServerSQL Server 公用程式的使用者資料庫總數Total number of user databases per SQL ServerSQL Server Utility 1,0001,000
每個資料庫的檔案群組數File groups per database 11
每個檔案群組的資料檔案數Data files per file group 11
每個資料庫的記錄檔案數Log files per database 11
每部電腦的磁碟區數Volumes per computer 33

SQL ServerSQL Server 公用程式所支援的 SQL ServerSQL Server 受管理之執行個體最大數可能會根據伺服器的硬體組態而有所不同。The maximum number of managed instances of SQL ServerSQL Server supported by SQL ServerSQL Server Utility may vary based on the hardware configuration of the server. 如需入門資訊,請參閱 SQL Server 公用程式的功能與工作For getting started information, see SQL Server Utility Features and Tasks. SQL ServerSQL Server 版本都提供 SQL Server 2016SQL Server 2016. 如需 SQL ServerSQL Server版本支援的功能清單,請參閱 SQL Server 2016 版本支援的功能For a list of features that are supported by the editions of SQL ServerSQL Server, see Features Supported by the Editions of SQL Server 2016.

SQL ServerSQL Server 資料層應用程式物件 SQL ServerSQL Server Data-tier Application Objects

SQL ServerSQL Server 資料層應用程式 (DAC) 中測試之各種物件的大小和數目上限。Maximum sizes and numbers of various objects that were tested in the SQL ServerSQL Server data-tier applications (DAC).

SQL ServerSQL Server DAC 物件 DAC object 大小/數目上限 SQL ServerSQL Server (64 位元)Maximum sizes/numbers SQL ServerSQL Server (64-bit)
每個 DAC 的資料庫數Databases per DAC 11
每個 DAC 的物件數Objects per DAC 受限於資料庫的物件數或可用的記憶體。Limited by the number of objects in a database, or available memory.

此限制所包括的物件類型為使用者、資料表、檢視表、預存程序、使用者定義函數、使用者定義資料類型、資料庫角色、結構描述和使用者定義資料表類型。The types of objects included in the limit are users, tables, views, stored procedures, user-defined functions, user-defined data type, database roles, schemas, and user-defined table types.

複寫物件 Replication Objects

SQL ServerSQL Server 複寫中已定義之各種物件的大小和數目上限。Maximum sizes and numbers of various objects defined in SQL ServerSQL Server Replication.

SQL ServerSQL Server 複寫物件 Replication object SQL Server 大小/數目上限 (64 位元)Maximum sizes/numbers SQL Server (64-bit)
發行項 (合併式發行集)Articles (merge publication) 20482048
發行項 (快照式或交易式發行集)Articles (snapshot or transactional publication) 32,76732,767
資料表中的資料行* (合併式發行集)Columns in a table* (merge publication) 246246
資料表中的資料行** ( SQL ServerSQL Server 快照式或交易式發行集)Columns in a table** ( SQL ServerSQL Server snapshot or transactional publication) 1,0001,000
資料表中的資料行** (Oracle 快照式或交易式發行集)Columns in a table** (Oracle snapshot or transactional publication) 995995
用於資料列篩選之資料行的位元組數 (合併式發行集)Bytes for a column used in a row filter (merge publication) 1,0241,024
用於資料列篩選之資料行的位元組數 (快照式或交易式發行集)Bytes for a column used in a row filter (snapshot or transactional publication) 8,0008,000

如果使用資料列追蹤來進行衝突偵測 (預設值),則基底資料表可包括的資料行行數上限為 1,024,不過,因為必須從發行項篩選資料行,所以發行的資料行行數上限為 246。If row tracking is used for conflict detection (the default), the base table can include a maximum of 1,024 columns, but columns must be filtered from the article so that a maximum of 246 columns is published. 如果使用資料行追蹤,則基底資料表可包括的資料行數上限為 246。If column tracking is used, the base table can include a maximum of 246 columns.

基底資料表可包含發行集資料庫中允許的最大資料行數 (如果是 SQL ServerSQL Server,則為 1,024 個),但如果資料行超出對發行集類型指定的最大值,則必須篩選發行項的資料行。The base table can include the maximum number of columns allowable in the publication database (1,024 for SQL ServerSQL Server), but columns must be filtered from the article if they exceed the maximum specified for the publication type.

另請參閱See Also

安裝 SQL Server 2016 的硬體與軟體需求 Hardware and Software Requirements for Installing SQL Server 2016
檢查 System Configuration Checker 的參數 Check Parameters for the System Configuration Checker
SQL Server 公用程式的功能與工作 SQL Server Utility Features and Tasks