Stored procedure definition: A set of pre-written T-SQL programs that can implement a function
Category: System stored procedures extended stored procedures user-defined stored procedures
User-defined stored procedure creation: (no parameter) up to 128M
Create PROC pr_ Example a stored procedure named Pr_ example One
The start of the as stored procedure topic
SQL statement for the SELECT * from category table stored procedure
GO
modifying stored procedures
ALTER PROC Pr_ Example One
As
SELECT * from category table ORDER by category name
GO
Executing stored procedures
EXEC Pr_ Example One
To delete a stored procedure
DROP Pr_ Example One
Creation of a parameter stored procedure (up to 2,100 parameters)
CREATE PROC Pr_ Example II
@id int 4,
@name nvarchar (20)
As
SELECT * from category table WHERE Id=@id and Name=@name
Go
Executing a stored procedure with parameters
EXEC Pr_ Example 21, Zhang San
SET NOCOUNT on does not return count information
SQL Server Stored Procedures