BEGIN
	-- DT030
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'DI025687';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT030] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT030] ADD CONSTRAINT [DT030DI025687_DEFAULT] DEFAULT 1 FOR [DI025687];
END
GO

BEGIN
	-- DT030
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'DI025688';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT030] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT030] ADD CONSTRAINT [DT030DI025688_DEFAULT] DEFAULT '0099QC' FOR [DI025688];
END
GO

BEGIN
	-- DT030
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'DI040818';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT030] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT030] ADD CONSTRAINT [DT030DI040818_DEFAULT] DEFAULT '001873' FOR [DI040818];
END
GO

BEGIN
	-- DT404
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'DI059306';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT404] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT404] ADD CONSTRAINT [DT404DI059306_DEFAULT] DEFAULT 1 FOR [DI059306];
END
GO

BEGIN
	-- DT518
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'DI059502';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT518] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT518] ADD CONSTRAINT [DT518DI059502_DEFAULT] DEFAULT 1 FOR [DI059502];
END
GO

BEGIN
	-- INTERFACE_CONFIG
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'LOGTYPE';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [INTERFACE_CONFIG] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [INTERFACE_CONFIG] ADD CONSTRAINT [DT560DI063844_DEFAULT] DEFAULT 496 FOR [LOGTYPE];
END
GO

BEGIN
	-- DT324
	DECLARE @CONSTRAINTNAME NVARCHAR(128);
	SELECT @CONSTRAINTNAME = D.NAME FROM SYS.DEFAULT_CONSTRAINTS D INNER JOIN SYS.COLUMNS C ON 
	D.PARENT_OBJECT_ID = C.OBJECT_ID AND D.PARENT_COLUMN_ID = C.COLUMN_ID
	WHERE C.NAME = 'LOG_TIMESTAMP';
	IF @CONSTRAINTNAME IS NOT NULL
		EXEC('ALTER TABLE [DT324] DROP CONSTRAINT "' + @CONSTRAINTNAME + '"');
	ALTER TABLE [DT324] ADD CONSTRAINT [DF_DT324_LOG_TIMESTAMP] DEFAULT sysdatetime() FOR [LOG_TIMESTAMP];
END
GO
