USE [Users_mdb]
GO

IF NOT EXISTS(SELECT nID FROM [dbo].[tblImport_ImpRule] WHERE nID=46)
BEGIN
	INSERT [dbo].[tblImport_ImpRule] ([nID], [nAuthID], [tName], [mFilter], [bAddNew], [bSynch], [nMailExt], [tExchangeServer], [nImportAuthType], [nSearchType], [bUseGlobalMappings], [nTypeProvisioningActions], [nImportType], [nProjectID], [tUniqueFields], [nImportSrc], [bImpADExtras]) 
	VALUES (46, 46, N'Chromebooks from XML', N'', 1, 1, 0, N'', 9, 1, 0, 1, 2, 15, N'tSID', 9, 0)
END
GO

/*** Add Fields to the ImpRule	***/
IF NOT EXISTS(SELECT * FROM [tblFieldMap_ImpRule] WHERE nID=46)
	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Comments', N'tblDts', 32, N'Notes', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'ComputerName', N'tblDts', 32, N'DeviceId', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Domain_Name', N'tblDts', 32, N'OrgUnitPath', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Location', N'tblDts', 32, N'AnnotatedLocation', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'MAC_Address', N'tblDts', 32, N'MacAddress', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Model', N'tblDts', 32, N'Model', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'MqAssetOwnerLookup', N'tblDts', 32, N'AnnotatedUser', 0, NULL, 0, 0, 0);
GO
IF NOT EXISTS(SELECT * FROM [tblFieldMap_ImpRule] WHERE nID=46)
	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'OS_Version', N'tblDts', 32, N'FirmwareVersion', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'PC_Model', N'tblDts', 32, N'Model', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Serial_Number', N'tblDts', 32, N'SerialNumber', 0, NULL, 0, 0, 0);
GO
IF NOT EXISTS(SELECT * FROM [tblFieldMap_ImpRule] WHERE nID=46)
	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'SN', N'tblDts', 32, N'SerialNumber', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'Source_Timestamp', N'tblDts', 32, N'LastSync', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'tBriefDescription', N'tblDts', 32, N'DeviceId', 0, NULL, 0, 0, 0);
GO

	INSERT [dbo].[tblFieldMap_ImpRule] ([nID], [tInternalFieldName], [tInternalTableName], [nInternalDSID], [tExternalFieldName], [nValueTableID], [tExternalFieldFormat], [bForeignKey], [bSyncOnlyNewRecord], [nCVLookupMode]) 
	VALUES (46, N'tSID', N'tblDts', 32, N'tSID', 0, NULL, 0, 0, 0);
GO
