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

    if(exists (select * from sys.objects where name ='Proc_AddGood'))
    drop proc Proc_AddGood
    go
    create proc Proc_AddGood
    @Gname varchar(50),
    @price money,
    @Gimg varchar(50),
    @Sid int,
    @SName varchar(50)
    as
    begin
    begin tran
    begin try
    insert into GoodInfo values(@Gname,@price,@Gimg,@Sid,@SName)
    commit tran
    end try

    begin catch
    rollback tran
    end catch

    end

    if(exists(select * from sys.objects where name ='Proc_AddShop'))
    drop proc Proc_AddShop
    go
    create proc Proc_AddShop
    @Sname varchar(50)
    as
    begin
    begin tran
    begin try
    insert into ShopInfo values(@Sname)
    commit tran
    end try

    begin catch
    rollback tran
    end catch

    end

    if(exists(select * from sys.objects where name ='Proc_AddUser'))
    drop proc Proc_AddUser
    go
    create proc Proc_AddUser
    @Uid int,
    @Uname varchar(50),
    @Upwd varchar(50)
    as
    begin
    begin tran
    begin try
    insert into UserInfo values(@Uid,@Uname,@Upwd)
    commit tran
    end try

    begin catch
    rollback tran
    end catch

    end


    if(exists(select * from sys.objects where name ='Proc_Login'))
    drop proc Proc_Login
    go
    create proc Proc_Login
    @Uname varchar(50),
    @Upwd varchar(50)
    as
    begin
    begin tran
    begin try
    select * from UserInfo where Uname=@Uname and Upwd = @Upwd
    commit tran
    end try

    begin catch
    rollback tran
    end catch

    end

    exec Proc_Login 'ym','123'

  • 相关阅读:
    net core 3.1 发布问题
    KCF追踪方法流程原理
    2
    1
    0
    LK光流算法公式详解
    MySql单表最大8000W+ 之数据库遇瓶颈记
    Quartz.net基于数据库的任务调度管理(Only.Jobs)
    轻量级代码生成器-OnlyCoder 第二篇
    轻量级代码生成器-OnlyCoder 第一篇
  • 原文地址:https://www.cnblogs.com/li1999/p/13274068.html
Copyright © 2011-2022 走看看