首页 > 解决方案 > Alterar una columna, para cambiar "nulo" a "no nulo", cuando no se conoce el tipo de datos

问题描述

我需要在一列中允许空值,但我不知道它的数据类型。在oracle中可以这样做:

alter table MyTable modify MyField null;

SQL server同源语句需要数据类型(在此示例中为INT

alter table MyTable alter column MyField int null;

有没有办法像 Oracle 那样做?这个想法是不必去数据字典查询类型和构建句子

谢谢,

标签: sql-servernullddlalter-tablealter-column

解决方案


推荐阅读