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’

相关文章:

  • 2021-08-07
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-09-25
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案