
UPDATE TBDD_MODULES SET PRODUCT_VERSION = '1.2.0.0' where SHORT_NAME = 'UM'
GO
CREATE OR ALTER PROCEDURE [dbo].[PRDD_DELETE_GROUP](@pGROUP_ID INT)
AS
BEGIN TRY
	-- COMMON
	IF OBJECT_ID(N'dbo.TBDD_GROUPS_USER', N'U') IS NOT NULL 
		DELETE FROM TBDD_GROUPS_USER WHERE GROUP_ID = @pGROUP_ID
	IF OBJECT_ID(N'dbo.TBDD_GROUPS_CLIENT', N'U') IS NOT NULL 
		DELETE FROM TBDD_GROUPS_CLIENT WHERE GROUP_ID = @pGROUP_ID
	IF OBJECT_ID(N'dbo.TBDD_GROUPS_MODULES', N'U') IS NOT NULL 
		DELETE FROM TBDD_GROUPS_MODULES WHERE GROUP_ID = @pGROUP_ID

	-- FINALLY
	DELETE FROM TBDD_GROUPS WHERE GUID = @pGROUP_ID

	RETURN 0
END TRY
BEGIN CATCH   
	PRINT 'FEHLER IN PROCEDURE: ' + CONVERT(VARCHAR(30),ERROR_PROCEDURE()) + ' - ZEILE: ' + CONVERT(VARCHAR(10),ERROR_LINE())
	+ ' - FEHLER-MESSAGE: ' 
    + CONVERT(VARCHAR(500),ERROR_MESSAGE())
	RETURN -1
END CATCH

GO