zoukankan      html  css  js  c++  java
  • SQL Server存储过程(二)

          (1)文章要点

             A。讲解结构化存储过程的编写。

           (2)在SQL server中实现结构化存储过程,我们首先需要知道用While关键字。以下我将会以代码延时怎么使用循环

            

    CREATE PROCEDURE [dbo].[Cp_Cal]
    (
    @Result int output)
    AS
    BEGIN
        
    -- SET NOCOUNT ON added to prevent extra result sets from
        -- interfering with SELECT statements.
        SET NOCOUNT ON;

        
    if @Result is null
           
    set @Result = 1

        
    declare @I int
         
        
    set @I = 1
      
        
    while @I <=10

        
    begin
       
           
    set @Result=@Result +@I

           
    Set @I=@I+1
        
        
    end

     执行存储过程之后,再调用存储过程,很方便,不用输入什么参数。

  • 相关阅读:
    Gym
    Gym
    Gym 101147B
    巴什博弈入门
    Hihocode 1304
    hihocoder 1441
    web前端
    ajax json html 结合
    关于获取各种浏览器可见窗口大小:
    原生JS 购物车及购物页面的cookie使用
  • 原文地址:https://www.cnblogs.com/luoguoqiang1985/p/1679747.html
Copyright © 2011-2022 走看看