日期:2014-05-16 浏览次数:20507 次
附注:微软认证考试70-461范围
第一部分:Create and alter stored procedures (simple statements).May include but not limited to: write a stored procedure to meet a given set of requirements; branching logic; create stored procedures and other programmatic objects; techniques for developing stored procedures; different types of storeproc result; create stored procedure for data access layer; program stored procedures, triggers, functions with T-SQL. 创建修改存储过程(简易语句)。可能包含但不仅限于:能够写出符合既定需求的存储过程;批处理逻辑;创建存储过程及其它可编程对象;了解各种存储过程开发相关技术;了解存储过程不同的返回结果类型;为某数据访问层创建存储过程;用T-SQL编写存储过程,触发器和函数。
CREATE PROCEDURE 存储过程名称 AS SELECT 语句 GO
EXECUTE
存储过程名称
或者EXEC
存储过程名称以下示例都将使用EXEC。
带参数的存储过程:
CREATE PROCEDURE my1 @lastname varchar(40), @firstname varchar(20) AS SELECT * FROM member WHERE firstname = @firstname AND lastname = @lastname GO
执行方法:不指名参数将按照声明的参数顺序传入。EXEC my1 'lastname','firstname'指名参数:EXECUTE my1 @lastname = 'last', @firstname = 'first'
或者
EXECUTE my1 @firstname = 'first', @lastname = 'last'