spDelete_Workflow

Parameters

Parameter Parameter Type Mode Description
@PKID int IN
@CurrentUsersID int IN

Definition

Copy


create PROCEDURE [dbo].[spDelete_Workflow]
(
    @PKID        int,
    @CurrentUsersID    int
)
AS
BEGIN
    set nocount on

    if exists(select null from dbo.vwSiteContent where [WorkflowID]=@PKID and [Status] in (0,1))
        begin
            raiserror('Unable to delete Workflow - There are draft/pending parts associated with it.',16,1)
            return 0
        end

    begin transaction

    DELETE FROM [dbo].[Workflow]
    WHERE ID=@PKID

    commit
END