USE [Users_mdb]
GO

IF NOT EXISTS (SELECT * FROM [dbo].[tblDefaultValue_ImpRule] WHERE nID=7 AND tInternalFieldName='Import_')
	INSERT INTO [dbo].[tblDefaultValue_ImpRule]
           ([nID] ,[tInternalFieldName] ,[tInternalTableName] ,[nInternalDSID],[tDefaultValue]
           ,[tConditionField] ,[tConditionValue] ,[nConditionIndex] ,[nCVLookupMode])
     VALUES
           (7, 'Import_','tblDts', 32, 1,
           NULL, NULL, 0, NULL);
ELSE
	UPDATE  [tblDefaultValue_ImpRule]
	SET tDefaultValue=1
	WHERE nID=7 AND tInternalFieldName='Import_' ;

GO
	
IF NOT EXISTS (SELECT * FROM [dbo].[tblDefaultValue_ImpRule] WHERE nID=9 AND tInternalFieldName='Import_')
	INSERT INTO [dbo].[tblDefaultValue_ImpRule]
           ([nID] ,[tInternalFieldName] ,[tInternalTableName] ,[nInternalDSID],[tDefaultValue]
           ,[tConditionField] ,[tConditionValue] ,[nConditionIndex] ,[nCVLookupMode])
     VALUES
           (9, 'Import_','tblDts', 32, 1,
           NULL, NULL, 0, NULL);
ELSE
	UPDATE  [tblDefaultValue_ImpRule]
	SET tDefaultValue=1
	WHERE nID=9 AND tInternalFieldName='Import_' ;
	
IF NOT EXISTS (SELECT * FROM [dbo].[tblDefaultValue_ImpRule] WHERE nID=43 AND tInternalFieldName='Import_')
	INSERT INTO [dbo].[tblDefaultValue_ImpRule]
           ([nID] ,[tInternalFieldName] ,[tInternalTableName] ,[nInternalDSID],[tDefaultValue]
           ,[tConditionField] ,[tConditionValue] ,[nConditionIndex] ,[nCVLookupMode])
     VALUES
           (43, 'Import_','tblDts', 32, 1,
           NULL, NULL, 0, NULL);
ELSE
	UPDATE  [tblDefaultValue_ImpRule]
	SET tDefaultValue=1
	WHERE nID=43 AND tInternalFieldName='Import_' ;

		   
GO

