默认值对象的创建与使用

 
默认值对象的创建与使用 
(1)使用T-SQL语句创建名为DF_GRADE的默认值对象,值为0。
(2)使用企业管理器将DF_GRADE绑定到成绩表Grade中的DailyGrade、PracticeGrade和TestGrade字段上。
(3)使用sp_unbindefault存储过程将DF_GRADE从DailyGrade、PracticeGrade和TestGrade字段上解除。
(4)删除DF_GRADE默认值对象。
---------------------------------------------------------------------------------------------------
create default DF_GRADE AS 0
go
CREATE TABLE grade (DailyGrade INT,PracticeGrade INT,TestGrade INT)
go
exec sp_bindefault 'DF_GRADE','grade.DailyGrade'
exec sp_bindefault 'DF_GRADE','grade.PracticeGrade'
exec sp_bindefault 'DF_GRADE','grade.TestGrade'
exec sp_unbindefault 'grade.DailyGrade'
exec sp_unbindefault 'grade.PracticeGrade'
exec sp_unbindefault 'grade.TestGrade'
go
DROP DEFAULT df_grade

                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值