SQL Server:将表数据类型减小到最小可能的空间,以克服最大允许表行大小为8060字节的限制? [英] SQL Server: table datatypes to smallest possible space to overcome limit of maximum allowable table row size of 8060 bytes?

查看:73
本文介绍了SQL Server:将表数据类型减小到最小可能的空间,以克服最大允许表行大小为8060字节的限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到与此处类似的错误

I am getting a similar error as here

创建或更改表'MediaLibrary'失败,因为最小行大小为14273,包括9字节的内部开销.这超过了表的最大允许行大小8060字节.

Creating or altering table 'MediaLibrary' failed because the minimum row size would be 14273, including 9 bytes of internal overhead. This exceeds the maximum allowable table row size of 8060 bytes.

在使用SQL Server Management Studio导入CSV之后.数字列被解释为字符串,因此,该数据类型可能是nchar(1000),而不是有效的(n)archer(x)数据类型,占用了大量不必要的空间.

after importing a CSV with SQL Server Management Studio. Number columns are interpreted as strings so, instead of efficient (n)archer(x) datatype, the datatype may be nchar(1000) taking a lot of unnecessary space.

如何查看导入到SQL Server的表的数据类型并更新它们以占用最小的空间?

How can I see the datatypes of the table imported to SQL Server and update them to take the smallest amount of space?

推荐答案

在sql数据库中创建表并定义具有适当数据类型的列,而不是将CSV导入表中如果表中只有字符串列,并且每列可以包含1000个字符,我认为您需要拆分表并加入视图

Create table in sql database and define columns with proper data types than import CSV into table if you have only string columns in table and each column can have 1000 chars I think that you need to split table and join in view

这篇关于SQL Server:将表数据类型减小到最小可能的空间,以克服最大允许表行大小为8060字节的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆