SQL Server Stored Procedures

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.