SqlServer修改表字段类型

if not exists (select 1 from syscolumns where name='字段名' and id=OBJECT_ID('表名') and 条件)
begin
    alter table 表名 alter column 字段名 类型 
end
Go

 

posted @ 2023-05-23 14:52  HoFei1113  阅读(133)  评论(0编辑  收藏  举报