第四课笔记:
字段的数据类型
字符型 N开头unicode编码(对不同语言间转换更支持单长度交非unicode更小)
系统表
用户定义表
临时表
分区表
保证数据完整性
6.设置标志字段
7 使用默认值
8 修改表
10、使用规则创建绑定
11、解除和删除规则
12、数据关系图
------------------------------------------------------------------------------------------------------------
---临时表 create table #test ( id int not null,name nvarchar(10) null,adress nvarchar(50) null ) --数据库看不到 但能查。 只对当前用户可见 新建查询就没了 select * from #test --全局临时表 新建查询也能查 create table ##test ( id int not null,adress nvarchar(50) null ) -----------用存储过程改表名 exec sp_rename 'mytest1','rename_mytest1' -----------加列 alter table rename_mytest1 add c_added int null ----------删 alter table rename_mytest1 drop column c_added ----------改列名 exec sp_rename 'rename_mytest1.c2','c存储过程改的','column' ----------改列属性 alter table rename_mytest1 alter column c存储过程改的 int null ----------------------规则 --创建 create rule sorce as @value between 0 and 100 --存储过程绑定到列 sp_bindrule sorce,'rename_mytest1.c1' --先解除才能删点规则 --解除 sp_unbindrule 'rename_mytest1.c1' --删除 drop rule sorce
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。