共享学习心得

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1.create function 通过将SQL包装加入到JAVA静态方法中,创建用户定义的函数.可返回一由该方法定义的值.

 

2.create index 创建表中一个或多个列的索引.

例子1.authors表的au_id列上创建名为au_id_ind的索引:

Create index  au_id_ind on  authors(au_id)

 

例子2.authors表的au_id列上创建名为au_id_ind的唯一聚族索引:

Create unique clustered  index  au_id_ind on  authors(au_id)

 

例子3 authors表的au_idtitle_id列上创建名为ind1的索引

Create index  ind1  on  authors  (au_id, title_id)

 

3.create plan  创建抽象计划

例子 为指定查询创建抽象计划.

Create  plan  “select  * from titles ” “(t_scan titles)”

 

4.create  procedure 创建存储过程或可以带一个或多个用户提供的参数的扩展存储过程.

例子

create  procedure  showed(@name  varchar(100))

as

select * from authors where name=@name

 

下面是执行showid的可接受的语法形式

Execute  showed  titles

execute  showed  @name=”tiltes”

 

5.create  role 创建用户定义角色.指定允许用于所创建的特定角色的口令有效期,最小口令长度和最大失败登陆次数.

例子1 创建名为doctor_role的角色

Create role doctor_role

 

例子2. 创建名为doctor_role且口令为haha的角色

Create role doctor_role with passwd “haha”

 

例子3 设置intern_role的有效期

Create role intern_role , with passwd “haha”, passwd ecpiration 6

 

例子4 设置intern_role的最大失败登陆次数

Create role intern_role , with passwd “haha”, max failed_logins 20

 

例子5 设置intern_role的最短口令长度

Create role intern_role , with passwd “haha”, min passwd length 0

 

6.create rule 为特定列或属于用户定义数据的任意列指定可接受值的域并创建访问规则.

例子1 创建一个名为limit的规则,该规则限制advance的值小于1000

Create  rule  linit

As @advance <1000

 

例子2 创建名为pubid_rule的规则,该规则限制pub_id的值为13,1415

Create rule  pubid_rule

As @pub_id in (‘13’,’14’,’15’)

 

 

 

 

posted on 2007-01-08 19:13  神秘狭  阅读(966)  评论(0编辑  收藏  举报