如何在 SQL Server 2008 中创建宽表? 它的使用限制是什么?

发布于 2024-07-23 06:03:34 字数 301 浏览 3 评论 0原文

我正在阅读 SQL Server 的最大容量规范,我发现了宽表的指定。 它与标准表的不同之处在于,标准表可以包含多达 30,000 列,而普通(窄)表则仅限于更熟悉的 1024 列。 我用谷歌搜索了宽表,但似乎没有相关的内容。 这种新的表类型有更正式的名称吗???

那么为什么我们有两种不同类型的表,如何创建这个特殊的表以及使用这个看似可以容纳更多数据的表有哪些限制? 有人知道吗?

I was reading the Maximum Capacity Specifications for SQL Server and I came across the designation of a wide table. It's different from a standard table in that is can have as many as 30,000 columns as opposed to a normal (narrow) table that is limited to the more familiar 1024 columns. I googled for wide table, but nothing seem to come up relevant. Does this new table type have a more formal name???

So why do we have two different types of tables, how do you create this special table and what are the limitations of using this table that can seemingly hold more data ? anhyone know ?

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

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

发布评论

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

评论(5

皓月长歌 2024-07-30 06:03:34

宽表是使用列集和稀疏列的表。 它仍然遵循相同的每行宽度限制(8019 字节) - 因此您通常只在列大部分为空时才使用它。

有关详细信息,请参阅此处...

A wide table is a table that uses column sets and sparse columns. It still follows the same width restrictions per row (8019 bytes) - so you'd typically only use it when your columns are mostly all nulls.

See here for more info on...

我做我的改变 2024-07-30 06:03:34

"要创建表或将表更改为宽表,请添加列集< /a> 到表定义。”

来自此处

"To create or change a table into a wide table, you add a column set to the table definition."

From here

昨迟人 2024-07-30 06:03:34

然而,您通常不想这样做! 行有大小限制,并且检索数据可能比使用相关表(即使是具有一对一关系的表)慢。 我还从未见过比相关表格更好的例子。

You usually do not want to do this however! There are size restrictions on the rows and it can be slower to retrieve data than if you use related tables (even those with one-to-one relationships). I've never yet seen an instance where this was a better idea than related tables.

老子叫无熙 2024-07-30 06:03:34

另一个限制是宽表不适用于事务或合并复制。 请参阅此处的“支持稀疏列的 SQL Server 技术”部分:http://msdn.microsoft.com/en-us/library/cc280604(v=sql.105).aspx

Another limitation is that wide tables don't work with transactional or merge replication. See the "SQL Server Technologies That Support Sparse Columns" section here: http://msdn.microsoft.com/en-us/library/cc280604(v=sql.105).aspx

给不了的爱 2024-07-30 06:03:34
CREATE TABLE [UR_DB].[dbo].[DesiredTableName]
(DocID int PRIMARY KEY,
Title varchar(200) NOT NULL,
ProductionSpecification varchar(20) SPARSE NULL,
ProductionLocation smallint SPARSE NULL,
MarketingSurveyGroup varchar(20) SPARSE NULL,
MarketingProgramID int SPARSE NULL,
SpecialPurposeColumns XML COLUMN_SET FOR ALL_SPARSE_COLUMNS);

创建复杂的测试数据库 - 创建包含超过 1,024 列的表

CREATE TABLE [UR_DB].[dbo].[DesiredTableName]
(DocID int PRIMARY KEY,
Title varchar(200) NOT NULL,
ProductionSpecification varchar(20) SPARSE NULL,
ProductionLocation smallint SPARSE NULL,
MarketingSurveyGroup varchar(20) SPARSE NULL,
MarketingProgramID int SPARSE NULL,
SpecialPurposeColumns XML COLUMN_SET FOR ALL_SPARSE_COLUMNS);

Creating Complex Test Databases - Creating a Table with more than 1,024 Columns

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