zoukankan      html  css  js  c++  java
  • 登录-存储过程

    select * from LoginUser

    go
    alter proc p_Add
    (
    @UserName nvarchar(50),
    @UserPassword nvarchar(50)
    )
    as
    begin
    insert into LoginUser values (@UserName,@UserPassword,0)
    select @@IDENTITY
    end

    go
    alter proc p_Login
    (
    @UserName nvarchar(50),
    @UserPassword nvarchar(50)
    )
    as
    begin
    select * from LoginUser where UserName=@UserName and UserPassword=@UserPassword and UserError<3
    end

    go
    create proc p_Update
    (
    @UserID int,
    @UserPassword nvarchar(50)
    )
    as
    begin
    update LoginUser set UserPassword=@UserPassword where UserID=@UserID
    select @@ROWCOUNT
    end

    go
    create proc p_Get
    as
    begin
    select * from LoginUser
    end

    exec p_Get

    go
    create proc p_Error
    (
    @UserName nvarchar(50)
    )
    as
    begin
    begin try
    begin tran
    Update LoginUser set UserError=UserError+1 where UserName=@UserName
    commit tran
    end try
    begin catch
    rollback tran
    end catch
    end

  • 相关阅读:
    SonarQube
    Gerrit
    Jenkins
    Jenkins
    GitLab
    GitLab
    GitLab
    centos7配置国内yum源
    CentOS7 ping: unknown host www.baidu.com
    VirtualBox下安装CentOS7系统
  • 原文地址:https://www.cnblogs.com/Wangyang11/p/10002855.html
Copyright © 2011-2022 走看看