sql server 添加字段并且赋默认值和说明

 

select soct.Captcha,CreateOn,* from SceneryOrderCheckTicket soct
right join
(
SELECT Captcha,convert(char(10),CreateOn,120) as createdate FROM dbo.SceneryOrderCheckTicket
where CreateOn>'2014-01-01' and Ord in(1,2,3,4)
group by Captcha,convert(char(10),CreateOn,120)
HAVING COUNT (Captcha)>1 ) ss on soct.Captcha=ss.Captcha
where CreateOn>'2014-01-01' and Ord in(1,2,3,4)
order by soct.Captcha

 

 

alter table MonthEnd_Unit
  add MEU_IsImport bit null default(0)
go

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是导入的月结' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MonthEnd_Unit', @level2type=N'COLUMN',@level2name=N'MEU_IsImport'
go

posted @ 2014-11-26 10:22  apegu  阅读(1214)  评论(0编辑  收藏  举报