--添加"紧急状态"字段
use [GUOYOUZI.Study]
go
IF(NOT EXISTS(SELECT 1 FROM sys.tables t JOIN sys.columns c ON c.object_id = t.object_id WHERE t.name='BasicInfo' AND c.name='EmergencyState'))
BEGIN
alter table [dbo].BasicInfo
add EmergencyState tinyint;

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description', 
   '紧急状态',
   'user', @CurrentUser, 'table', 'BasicInfo', 'column', 'EmergencyState'
end
posted on 2020-01-03 16:13  JioNote  阅读(279)  评论(0编辑  收藏  举报