📄 snoto14
字号:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE P_ZFXX_VIEW
@nRet smallint out
AS
Set NoCount On
set @nret= 0
begin Tran
select ZFBH,LYMC=b.mc,HX=c.mc,LC,CX=d.mc,DJ=e.mc,YT=f.mc,
SFFP=(case when sffp = '1' then '未分' else '已分' end),
KFFP=(case when kffp = '1' then '可分' else '不可分' end),
SFZH
from zfxxb a, lyxxb b, fwhxb c, fwcxb d, fwdjb e, fwytb f
where a.lybh= b.lybh and
a.hxbh= c.bh and
a.cxbh= d.bh and
a.djbh= e.bh and
a.ytbh= f.bh
set @nRet =@@error
If @nRet <>0
Rollback Tran
Else
Commit Tran
Return
--结束
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER procedure P_TestCX
@LYBH char(5)='', --楼宇编号
@BH char(2)='', -- 房屋编号后两位
@cxmc varchar(12) out, --朝向名称
@nRet smallint=0 out -- 返回值
as
set nocount on
set @nRet=1
begin tran
select zfbh,lybh,hxbh,cxbh,dwbh into #temp_T from zfxxb where lybh=@LYBH
select cxbh,cnt=count(*),bh=substring(zfbh,9,2) into #temp_table from #temp_T
group by cxbh,substring(zfbh,9,2)
select bh,cnt=max(cnt) into #temp1 from #temp_table
group by bh
select @cxmc= c.mc from #temp_table a,#temp1 b,fwcxb c
where a.cnt=b.cnt and a.bh=b.bh and a.cxbh=c.bh and b.bh =@BH
drop table #temp_T
drop table #temp_table
drop table #temp1
Set @nRet=@@Error
If @nRet <>0
Rollback Tran
Else
Commit Tran
return
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -