USE [Configuration01_Dat]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF (NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES  WHERE TABLE_SCHEMA = 'dbo' AND  TABLE_NAME = 'tblImp_DefaultValue'))
BEGIN
    
	CREATE TABLE [dbo].[tblImp_DefaultValue](
		[nID] [int] NULL,
		[tInternalFieldName] [nvarchar](255) NULL,
		[tInternalTableName] [nvarchar](255) NULL,
		[nInternalDSID] [int] NULL,
		[tDefaultValue] [nvarchar](255) NULL,
		[tConditionField] [nvarchar](255) NULL,
		[tConditionValue] [nvarchar](255) NULL,
		[nConditionIndex] [int] NULL,
		[nCVLookupMode] [int] NULL,
		[nFieldID] [int] NULL
	) ON [PRIMARY]
END

GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='Can_Log_In')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'Can_Log_In', N'tblUser', 16, N'1', NULL, NULL, 0, 0, 93)
GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='nStateID')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'nStateID', N'tblUser', 16, N'1', NULL, NULL, 0, 0, 90)
GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='nCategoryID')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'nCategoryID', N'tblUser_Employment', 16, N'4', NULL, NULL, 0, 0, 21)
GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='Security_Type')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'Security_Type', N'tblUser', 16, N'8', NULL, NULL, 0, 0, 45)
GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='nCompanyName')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'nCompanyName', N'tblUser', 16, N'17', NULL, NULL, 0, 0, 24)
GO

IF NOT EXISTS (SELECT * FROM [tblImp_DefaultValue] WHERE nID=5 AND tInternalFieldName='Roles')
	INSERT [dbo].[tblImp_DefaultValue] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tDefaultValue], [tConditionField], [tConditionValue], [nConditionIndex], [nCVLookupMode], [nFieldID]) 
	VALUES (5, N'Roles', N'tblUser', 16, N'Individual', NULL, NULL, 0, 0, 77)
GO

