---
title: "Error when running the Drill Log By DataSet report"
canonical: "https://servicedesk.maxgeo.com/space/DS/1125712313/Error%20when%20running%20the%20Drill%20Log%20By%20DataSet%20report"
format: markdown
---
When running the Drill Log by Dataset report in DataShed5.2.3, you may experience the following error message displaying:

![image](media://e3749cef-52d1-4077-a299-05982eefb7ca)

This may occur if an MDS does not have the following elements configured in the tblAssayFlat table

Au_ppm, Cu_ppm, Ag_ppm, Ni_ppm, As_ppm.

If this is the case, you can configure this report in the MDS to run with different elements that are specified from the client.

Running the attached sql script on the MDS database will reset the elements to the client specified elements.   
Please note: before running script change the elements that are referenced in the script to the client specified elements.


**SQL Script**

```sql
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
-- Sets the Drill Log by Dataset report parameter values  --------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
-- Modify the following to set parameter Values
-- Element 1: replace Au_ppm  
-- Element 2: replace Cu_ppm
-- Element 3: replace Ag_ppm
-- Element 4: replace Ni_ppm
-- Element 5: replace As_ppm
-- Chart Column Lithology/Lith-Code1: replace tblDHLithology  replace Lith1_Code
-- Chart Column Minerals/Min1_Code  : replace tblDHMinerals   replace Min1_Code
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
  if not exists ( select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and codeGroup = 'EXPORTLAYOUT' and code = 'MSACCESS')
  INSERT INTO [MDS].[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ('DataShed5','EXPORTLAYOUT','1033','MSACCESS','0','SYSTEM','VISIBLE','TRUE')

if not exists ( Select * from [MDS].[tblSYSMappingAppCodeGroup] where appcode = 'DataShed5' and Codegroup = 'REPORT')
BEGIN
  insert into [MDS].[tblSYSMappingAppCodeGroup] (AppCode, CodeGroup, LanguageID, Description, IsActive, ParentCodeGroup, SortOrder)
  VALUES ('DataShed5','REPORT','1033','Reporting configuration',1,null,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCodeGroup] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti')
BEGIN
  insert into [MDS].[tblSYSMappingAppCodeGroup] (AppCode, CodeGroup, LanguageID, Description, IsActive, ParentCodeGroup, SortOrder)
  VALUES ('DataShed5','xrDrillLogReportMulti','1033','Drill Log Report',1,'REPORT',1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName1')
BEGIN
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pElementFieldName1','1033','Element 1',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName2')
BEGIN
    Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pElementFieldName2','1033','Element 2',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName3')
BEGIN
    Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pElementFieldName3','1033','Element 3',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName4')
BEGIN
    Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pElementFieldName4','1033','Element 4',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName5')
BEGIN  
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pElementFieldName5','1033','Element 5',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pstrLithTableName')
BEGIN  
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pstrLithTableName','1033','Column 6 Table Name',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pLithologyDataField1')
BEGIN  
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pLithologyDataField1','1033','Column 6 Field Name',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pMineralTableName')
BEGIN  
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pMineralTableName','1033','Column 7 Table Name',1,1)
END

if not exists ( Select * from [MDS].[tblSYSMappingAppCode] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pMineralDataField')
BEGIN  
  Insert into [MDS].[tblSYSMappingAppCode] (AppCode, CodeGroup, Code, LanguageID, Description, Is_Required, IsActive)
  VALUES('DataShed5','xrDrillLogReportMulti','pMineralDataField','1033','Column 7 Field Name',1,1)
END
 
delete from  [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and ParamName = 'DefaultParamValue'

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName1' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pElementFieldName1',0,'SYSTEM','DefaultParamValue','Au_ppm')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName2' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pElementFieldName2',0,'SYSTEM','DefaultParamValue','Cu_ppm')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName3' and ParamName = 'DefaultParamValue')
BEGIN
    insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pElementFieldName3',0,'SYSTEM','DefaultParamValue','Ag_ppm')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName4' and ParamName = 'DefaultParamValue')
BEGIN
      insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pElementFieldName4',0,'SYSTEM','DefaultParamValue','Ni_ppm')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pElementFieldName5' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pElementFieldName5',0,'SYSTEM','DefaultParamValue','As_ppm')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pMineralTableName' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pMineralTableName',0,'SYSTEM','DefaultParamValue','tblDHMinerals')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pMineralDataField' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pMineralDataField',0,'SYSTEM','DefaultParamValue','Min1_Code')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pstrLithTableName' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pstrLithTableName',0,'SYSTEM','DefaultParamValue','tblDHLithology')
END

if not exists ( Select * from [MDS].[tblSYSMappingAppConfigVals] where appcode = 'DataShed5' and Codegroup = 'xrDrillLogReportMulti' and code = 'pLithologyDataField1' and ParamName = 'DefaultParamValue')
BEGIN
  insert into MDS.[tblSYSMappingAppConfigVals] (AppCode, CodeGroup, LanguageID, Code, ConfigID, UserID, ParamName, ParamValue)
  VALUES ( 'DataShed5','xrDrillLogReportMulti','1033','pLithologyDataField1',0,'SYSTEM','DefaultParamValue','Lith1_Code')
END
```