CREATE PROCEDURE [dbo].[sp_stat_info] (@city nvarchar(20),@town nvarchar(20),@village nvarchar(20))asdeclare @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_2if @city='aaa' beginselect @yd_num=count(jmzh) from jfxd.t_gongan_end_2 where SERIAL_NUMBER is not nullselect @lt_num=count(jmzh) from jfxd.t_gongan_end_2 where unicom is not nullselect @gh_num=count(jmzh) from jfxd.t_gongan_end_2 where tel is not nullselect @xlt_num=count(jmzh) from jfxd.t_gongan_end_2 where little_tel is not nullendelse if @town='bbb' begin//sql语句endelsebegin//sql语句endupdate t_stat_info set……GO