我使用的是 SQL Server 2008,我需要在大约 500k 行的表上将 VARCHAR 字段设置得更大,从(200 到 1200).我需要知道的是是否有任何我没有考虑过的问题.
I'm using SQL Server 2008 and I need to make a VARCHAR field bigger, from (200 to 1200) on a table with about 500k rows. What I need to know is if there are any issues I have not considered.
我将使用这个 TSQL 语句:
I will be using this TSQL statement:
ALTER TABLE MyTable
ALTER COLUMN [MyColumn] VARCHAR(1200)
我已经在一份数据副本上尝试过,这个声明没有我能看到的不良影响.
I've already tried it on a copy of the data and this statement had no ill effects that I could see.
那么这样做是否有任何我可能没有考虑过的问题?
So are there any possible problems from doing this that I may not have considered?
顺便说一下,该列未编入索引.
By the way, the column is not indexed.
这只是元数据更改:它很快.
This is a metadata change only: it is quick.
观察:如果 SET ANSI_xx 设置之一不同,则明确指定 NULL 或 NOT NULL 以避免事故",例如出于某种原因在 osql 而非 SSMS 中运行
An observation: specify NULL or NOT NULL explicitly to avoid "accidents" if one of the SET ANSI_xx settings are different eg run in osql not SSMS for some reason
这篇关于在大表上增加 VARCHAR 列的大小时会出现任何问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
我应该使用什么 SQL Server 数据类型来存储字节 What SQL Server Datatype Should I Use To Store A Byte[](我应该使用什么 SQL Server 数据类型来存储字节 [])
解释 SQL Server 中 sys.objects 中的类型代码Interpreting type codes in sys.objects in SQL Server(解释 SQL Server 中 sys.objects 中的类型代码)
Typeorm .loadRelationCountAndMap 返回零Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL:ISDATE() 是否应该返回“1"?什么时候不能MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否应该返回“1?什么时候不能投射为日期?)
将一天的名称转换为其整数表示Converting the name of a day to its integer representation(将一天的名称转换为其整数表示)
如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yHow to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yyyy?)