条件判断呀,如果@flag...就执行第一段

解决方案 »

  1.   

    @flag是存储过程的输入参数,如果在调用该存储过程时该参数值为'A',则执行if(@flag='A')后面的代码,其余同理
      

  2.   

    if @flag='a'如果 参数@flag的值等于常量A的话就执行
      

  3.   

    在前面还加上了这句是什么判断这个存储过程有还是没有吗?
    use buygoods1
    go
    if object_id('dbo.GetOrderNum') is not null
    drop procedure dbo.GetOrderNum
    go
      

  4.   

    在前面还加上了这句是什么判断这个存储过程有还是没有吗?
    use buygoods1
    go
    if object_id('dbo.GetOrderNum') is not null
    drop procedure dbo.GetOrderNum
    go
    如果存在该存储过程就先删除。
      

  5.   

    如果程序调用此存储过程时,如果是"A"就执行
    select item=count(*) from InGoods where vendor=@vendor 
    and CKYEAR=@ckyear and CKMONTH=@ckmonth
    return如果程序调用此存储过程时,如果是"Y"就执行
    select item=count(*) from InGoods where vendor=@vendor 
    and CKYEAR=@ckyear and CKMONTH=@ckmonth and STATUS='OK'
    return