Merge two stored procedures into one SQL Server

Last Reply on May 10, 2012 04:36 AM By Mudassar

Posted on May 10, 2012 04:35 AM

HI every one

i have 2 procedure in my DB 

1-

 

 

 

ALTER procedure [dbo].[selectproduct]
@H_name nvarchar(50)
as

begin
select Name,H_name,image,Description
from House_p
where H_name=@H_name
group by  Name,H_name,image,Description
end

 

 

2-

 

 

ALTER PROCEDURE [dbo].[GetProducts]
(

@Region tinyint
)
AS
BEGIN
    SET NOCOUNT ON;
    
SELECT House_Info.BehCode,
 House_Info.Region,House_Info.City,House_p.Name,House_p.Description
,House_p.image

FROM House_Info LEFT OUTER JOIN House_p ON House_Info.Behcode = House_p.Behcode
WHERE  LOWER(House_Info.Region) = LOWER(@Region)
end

 

 

I want use these 2 procedure in 1 procedure how i can it?

 

thanks 

Posted on May 10, 2012 04:36 AM

Not possible as one stored procedure can have only one select query