创建存储过程的简单例子

来源:互联网 发布:js input file 赋值 编辑:程序博客网 时间:2024/04/30 13:10

USE Adventureworks
--Create a  new procedure for querying
CREATE PROCEDURE HumanResources.GetEmployeeName
AS
SELECT LastName,FirstName,Department FROM HumanResources.vEmployeeDepartment
GO
--when you finish your procedure,you can test it by the command 'EXEC'
EXEC HumanResources.GetEmployeeName
--Then the result of the procedure will be displayed follows