SQL?и???е?????????
???????????? ???????[ 2016/6/13 10:20:26 ] ????????????? SQL
??????????з?????????default???
?????????£?
????alter table ???? alter column ???? ????????
??????????????????С???default???
????(1)???????
????alter table ???? drop constraint ????????
????(2)????????????
????alter table ???? alter column ???? ???????? not null
????(3)???????
????alter table ???? add constraint ???????? primary key (???????1?????????2)
??????????????????У???default???
????(1)???????
????alter table ???? drop constraint ????????
????(2)???default???
????USE ???????
????IF EXISTS (SELECT name FROM sysobjects
????WHERE name = 'default?????'
????AND type = 'D')
????BEGIN
????EXEC sp_unbindefault '?????.???'
????END
????GO
????(3)????????????
????alter table ???? alter column ???? ???????? not null
????(4)???????
????alter table ???? add constraint ???????? primary key (???????1?????????2)
???????????
????(1)?????????????????????????
????declare @name varchar(50)
????select @name =b.name from sysobjects b join syscolumns a on b.id = a.cdefault
????where a.id = object_id('????')
????and a.name ='????'
????(2)????????????????????????????????????а??????futureonly??
??????????????? def_ssn ???????????????????? ssn?????????? futureonly?????????????? ssn ???????С?
????USE ???????
????EXEC sp_bindefault '????'?? '?????????????'?? 'futureonly'
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11