如何创建存储过程 [英] how to create a store procedure

查看:68
本文介绍了如何创建存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

告诉我创建存储过程的答案

tell me answer of creation of store procedure

推荐答案

http://msdn.microsoft.com/en-us/library/ms187926.aspx [ SQL Server存储过程概述 [
Start with http://msdn.microsoft.com/en-us/library/ms187926.aspx[^].

You can also have a look at Overview of SQL Server Stored Procedure[^].


请投票....


Please Vote....


-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName>
    -- Add the parameters for the stored procedure here
    <@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>,
    <@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for procedure here
    SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END
GO


尝试一下:
http://msdn.microsoft.com/en-us/library/aa258259%28v = sql.80%29.aspx [ ^ ]
Try this:
http://msdn.microsoft.com/en-us/library/aa258259%28v=sql.80%29.aspx[^]


这篇关于如何创建存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆