IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_delete_branch]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_delete_branch]
GO
CREATE procedure [dbo].[mps_delete_branch]
-- Add the parameters for the stored procedure here
@cmpid int,
@mybcid int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DELETE mps_branch WHERE bc_id = @mybcid AND bc_cmpid = @cmpid
DELETE mps_depart WHERE dp_bcid = @mybcid AND dp_cmpid = @cmpid
END