2006/02/12 | 存储过程 触发器
类别(数据库学习笔记) | 评论(0) | 阅读(30) | 发表于 15:42

Create ProC [EDURE] procedure_Name
[
{(@param data_Type)} [=default] [output]
]
[...n]
[
with
[With
{
recompile | ENCRYPTION | RECOMPIL,ENCRYPTIOn
}
]
]
as sql_Statement [...n]


if Exists(select name from sysobjects where name ='title_Sum' and type='P'


crate Trigger trigger_name
on table with encryption
for {[delete,insert,update]} not for replication
as sql_statement []
[return integer_Expression]


use northwind
go

create trigger tr_product_update on products
for update
as
Declare @msg varchar(100)
select @msg =str(@@rowcount) +" employees updated by this statement"
print @Msg

return
go
0

评论Comments