Forum Discussion
MarcusH
5 hours agoValued Contributor
We have a BR that reads the Audit tables for each of the elements. It takes a start and end time range and prints that information to an Excel spreadsheet. It has a check sheet to show what has been reviewed:
And then each element has a sheet where the changes are listed. The amount of information varies by element: Business Rules
Metadata:
This is all available from the Audit tables. When you have worked out how to read one table the others are much easier. This is an example of the SQL for Business Rules:
sql.AppendLine("SELECT ")
sql.AppendLine("(Case ")
sql.AppendLine("When AuditInsUpdateDel = 0 Then 'Add' ")
sql.AppendLine("When AuditInsUpdateDel = 1 Then 'Update' ")
sql.AppendLine("When AuditInsUpdateDel = 2 Then 'Delete' ")
sql.AppendLine("Else 'Unknown' ")
sql.AppendLine("End) As 'Change Type' ")
sql.AppendLine(", BusinessRuleType ")
sql.AppendLine(", Name as 'BusinessRuleName' ")
sql.AppendLine(", AuditUser as 'ChangedBy' ")
sql.AppendLine(", AuditTime ")
sql.AppendLine(", FORMAT(AuditTime, 'dd/MMM/yyyy') AS ChangeDate ")
sql.AppendLine(", FORMAT(AuditTime, 'HH:mm') AS ChangeTime ")
sql.AppendLine(" FROM AuditBusinessRule ")
sql.AppendLine($" WHERE AuditTime >= '{formattedStartDate} 00:00:00' AND AuditTime <= '{formattedEndDate} 23:59:59' ")
sql.AppendLine(" ORDER BY BusinessRuleType, Name, AuditTime ")
Related Content
- 8 months ago
- 2 years ago
- 4 years ago
- 2 years ago
- 2 years ago