2、创建存储过程
--创建名为 GetStuCou_DSS 的返回多个结果集的存储过程
create procedure GetStuCou_DSS
@StuNo nvarchar(64),
@Height nvarchar(32)
as
begin
if(@StuNo is not null and @StuNo <> '')
begin
select *
from Student
where S_StuNo=@StuNo
end
if(@Height is not null and @Height <> '')
begin
select *
from Student
where S_Height=@Height
end
end
--执行名为 GetStuCou_DSS 的返回多个结果集的存储过程
execute GetStuCou_DSS '005','185'
3、创建触发器
CREATE [ OR ALTER ] TRIGGER [ schema_name . ]trigger_name
ON { table }
[ WITH <dml_trigger_option> [ ,...n ] ]
{ FOR | AFTER }
{ [ INSERT ] [ , ] [ UPDATE ] [ , ] [ DELETE ] }
AS { sql_statement [ ; ] [ ,...n ] }
<dml_trigger_option> ::=
[ NATIVE_COMPILATION ]
[ SCHEMABINDING ]
[ EXECUTE AS Clause ]
https://www.cnblogs.com/Brambling/archive/2017/04/21/6741666.html
4、创建分区函数
5、表值函数
6、数据库优化
转载请注明出处:
未经允许不得转载:lxfamn » 计算机三级数据库考点