本文介绍了SQL Server中改变表列字段长度的SQL是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使字段从 nvarchar(50) 变为 nvarchar(250) 的 SQL 是什么?
What is the SQL to make a field go from nvarchar(50) to nvarchar(250)?
当我尝试通过 SQL Server Management Studio 更改它时,它不允许我这样做,所以我想我会直接尝试 SQL 而不是使用 GUI.
When I try to change it through the SQL Server Management Studio, it doesn't allow me to do it, so I figured I would try SQL directly instead of using the GUI.
推荐答案 Alter table tblname ALTER Column colname nvarchar(250) [NOT] NULL如果未指定 NULL/NOT NULL,则无论原始规范是什么,该列都将变为 Nullable.
If NULL / NOT NULL is not specified the column will become Nullable irrespective of what ever the original specification was.
更多推荐
SQL Server中改变表列字段长度的SQL是什么
发布评论