日期:2014-05-17 浏览次数:20675 次
IF EXISTS(SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('TESTPROC') AND type = 'P')
DROP PROC TESTPROC
GO
CREATE PROC TESTPROC
@VYWLX NVARCHAR(10) ,
@VHPZL NVARCHAR(10) ,
@VHPHM NVARCHAR(30)
AS
BEGIN
DECLARE @vywblzl INT,
@VCOUNT1 INT,
@RES INT
SET @vywblzl= CASE @VYWLX WHEN '02' THEN 1
WHEN '03' THEN 2
WHEN '04' THEN 3
WHEN '05' THEN 4
WHEN '06' THEN 5
END;
SET @VCOUNT1=( SELECT COUNT(*)
FROM sh_veh_jdc
WHERE clx=@vywblzl
and HPZL=@VHPZL
and HPHM=@VHPHM
and [status]<>2)
IF @VCOUNT1>=1
SET @RES=1
ELSE IF @VCOUNT1=0
SET @RES=0
ELSE
SET @RES=2
SELECT @RES
END
--TRY
IF object_id('test') IS NOT NULL
DROP PROC test
GO
CREATE PROC test
(
@VYWLX VARCHAR(50),
@VHPZL VARCHAR(50),
@VHPHM VARCHAR(50),
@RES TINYINT OUTPUT
)
AS
DECLARE @vywblzl INT,@VCOUNT1 INT
SET @vywblzl= CASE @VYWLX WHEN '02' THEN 1
WHEN '03' THEN 2
WHEN '04' THEN 3
&n