EnVisageOnline/Beta/Database/Schema/Stored Procedures/dbo.sp_DeletePeopleResource...

22 lines
1.2 KiB
Transact-SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Run this script on SQL Server 2008 or later. There may be flaws if running on earlier versions of SQL Server.
*/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_DeletePeopleResource]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[sp_DeletePeopleResource]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[sp_DeletePeopleResource] (@id uniqueidentifier)
AS
BEGIN
begin transaction
delete from PeopleResourceAllocation where ResourceId = @id
delete from PeopleResource where Id = @id
commit transaction
END
GO