问题描述
我收到与此处类似的错误
I am getting a similar error as here
在使用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 tableif 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字节的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!