I have a stored procedure like this:
ALTER procedure [dbo].[MobileDevice]
@platesourcecnt integer,
@plateCategory integer
as
begin
declare @SplateSourcecount integer,
@SplateCategory integer,
@Splatecode integer
select @SplateSourcecount= count(ps.PSID)from PlateSource_tbl ps
if @SplateSourcecount <> @platesourcecnt
begin
select PSID,PS from PlateSource_tbl where Deleted=0
end
else
begin
return 1
end
Select @SplateCategory=COUNT(pcat.PCID) from PlateCategory_tbl pcat
if @SplateCategory <> @plateCategory
begin
select PCID,PC,PSID from PlateCategory_tbl where Deleted=0
end
else
begin
return 2
end
end
Here my platesource_tbl count is 13, if I pass value to @platesourcecnt =13 then I am getting return value 1 but that time my second select query is not working.
If I pass other parameter than 13 to @platesourcecnt then getting both working.
What is wrong with my stored procedure?
Can I get multiple return value in one stored procedure?