USE [EnVisage]
GO

/****** Object:  StoredProcedure [dbo].[sp_DeleteResource]    Script Date: 10/6/2014 3:29:44 PM ******/
DROP PROCEDURE [dbo].[sp_DeleteResource]
GO

/****** Object:  StoredProcedure [dbo].[sp_DeleteResource]    Script Date: 10/6/2014 3:29:44 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE PROCEDURE [dbo].[sp_DeletePeopleResource] (@id uniqueidentifier)
AS
BEGIN
	begin transaction

	delete from PeopleResource2Teams where ResourceId = @id
	delete from PeopleResource2ExpenditureCategories where ResourceId = @id
	delete from PeopleResourceAllocation where ResourceId = @id
	delete from PeopleResource where Id = @id

	commit transaction
END


GO


