当前位置:首页 > 网络编程 > WEB编程 > ASP.net >  SQL IF..ELSE..在存储过程的使用规范

 SQL IF..ELSE..在存储过程的使用规范

点击次数:27 次 发布日期:2008-11-26 12:01:21 作者:源代码网
源代码网推荐      CREATE PROCEDURE [dbo].[sp_stat_info]
源代码网推荐  (
源代码网推荐  @city nvarchar(20),
源代码网推荐  @town nvarchar(20),
源代码网推荐  @village nvarchar(20)
源代码网推荐  )
源代码网推荐  as
源代码网推荐  declare @num numeric(10)
源代码网推荐  declare @yd_num numeric(10)
源代码网推荐  declare @lt_num numeric(10)
源代码网推荐  declare @gh_num numeric(10)
源代码网推荐  declare @xlt_num numeric(10)
源代码网推荐  select @num=count(jmzh) from jfxd.t_gongan_end_2
源代码网推荐  if @city="aaa"
源代码网推荐  begin
源代码网推荐  select @yd_num=count(jmzh) from jfxd.t_gongan_end_2 where SERIAL_NUMBER is not null
源代码网推荐  select @lt_num=count(jmzh) from jfxd.t_gongan_end_2 where unicom is not null
源代码网推荐  select @gh_num=count(jmzh) from jfxd.t_gongan_end_2 where tel is not null
源代码网推荐  select @xlt_num=count(jmzh) from jfxd.t_gongan_end_2 where little_tel is not null
源代码网推荐  end
源代码网推荐  else if @town="bbb"
源代码网推荐  begin
源代码网推荐  //sql语句
源代码网推荐  end
源代码网推荐  else
源代码网推荐  begin
源代码网推荐  //sql语句
源代码网推荐  end
源代码网推荐  update t_stat_info set……
源代码网推荐  GO
源代码网推荐    做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。
源代码网推荐


源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华