示例如下
示例將創建 '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';