Stored Procedures [dbo].[DELETE_UND_PROBE]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@probe_id_1bigint8
Permissions
TypeActionOwning Principal
GrantExecuteuniadmin
GrantExecuteuniuser
SQL Script
/****** Object:  Stored Procedure dbo.DELETE_UND_PROBE    Script Date: 12/1/2005 11:50:13 PM ******/

/****** Object:  Stored Procedure DELETE_UND_PROBE    Script Date: 3/25/2005 2:24:50 PM ******/
CREATE PROCEDURE [DELETE_UND_PROBE]
    (@probe_id_1     [bigint])



AS

DECLARE @liRecCount integer

SET @liRecCount = 0

SELECT @liRecCount  = ( SELECT count(*)  from und_task where probe_id = @probe_id_1 )

IF @liRecCount > 0
BEGIN
    -- Need to update the job and task table as well
    -- Handle this as a transactional unit.
    UPDATE [srdb].[und_probe]
    SET [status] = 'deleted'
    WHERE ( [probe_id]     = @probe_id_1)

END
ELSE
    BEGIN
    DELETE [srdb].[und_probe]
    WHERE
        ( [probe_id]     = @probe_id_1)
    END
GO
GRANT EXECUTE ON  [dbo].[DELETE_UND_PROBE] TO [uniadmin]
GRANT EXECUTE ON  [dbo].[DELETE_UND_PROBE] TO [uniuser]
GO
Uses