IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_delete_warehouse]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_delete_warehouse]
GO
create proc [dbo].[mps_delete_warehouse]
@mywhid int
as
begin
set nocount on 
if not exists(select * from mps_warehouse_data where whg_whid = @mywhid)
begin
DELETE mps_warehouse WHERE wh_id = @mywhid
select 'ok'  result1
end
else select 'error' result1
set nocount off
end