示例如下
示例将创建 'HumanResources.uspGetAllEmployeesTest
存储过程。 第二个示例将存储过程重命名为 HumanResources.uspEveryEmployeeTest
。
--Create the stored procedure. USE AdventureWorks2012; GO CREATE PROCEDURE HumanResources.uspGetAllEmployeesTest AS SET NOCOUNT ON; SELECT LastName, FirstName, Department FROM HumanResources.vEmployeeDepartmentHistory; GO --Rename the stored procedure. EXEC sp_rename 'HumanResources.uspGetAllEmployeesTest', 'uspEveryEmployeeTest';