zoukankan      html  css  js  c++  java
  • create procedure grammar

    Create procedure  pre_name
    @variable list
    as
    pro_doby

    Eg. Create procedure sp_GetUserInformation
        @userid char(15)=’00001’,
        @username char(2) output,  //which means username is outout
        @address char(40) outout,
        @email char(30)
       As
        Select userid,@username=username,@address=address,@email=email
        From t_userinfo
        Where userid=@userid
    //statements: if the parameter has default value when creating procedure , then when we call the procedure, we can igonore the parameters which makes no error.
    Eg. CREAT PROCEDURE SP_TEST
        USERID VARCHAR(10)=’982135’
           AS
    SELECT * FROM T_USERNAME
    WHERE USERID=@USERID;
    GO
    When we call the procedure, we can write this:
     àsp_test  (the default value of parameter userid is 982135,so we can ignore it)
     or   àsp_test ‘00001’

  • 相关阅读:
    Intern Day7
    Intern Day7
    Intern Day7
    Intern Day6
    Intern Day6
    Intern Day6
    Intern Day6
    Intern Day6
    萧萧远树疏林外,一半秋山带夕阳
    飞线
  • 原文地址:https://www.cnblogs.com/Winston/p/1040957.html
Copyright © 2011-2022 走看看