mssql 增加刪除字段
2023-12-29 10:39 bgbing 閱讀(146) 評論(0) 收藏 舉報(bào)--判斷字段不存在則添加 if not exists(select * from sys.columns where name='字段名' and [object_id]=object_id(N'表名')) alter table 表名 add 字段名 nvarchar(255) --判斷字段存在則刪除 if exists(select * from sys.columns where name='字段名' and [object_id]=object_id(N'表名')) alter table 表名 drop column 字段名
原文鏈接:https://blog.csdn.net/qq_22103321/article/details/122831763
浙公網(wǎng)安備 33010602011771號