Wednesday, 11 February 2015

Management Reporter Integration Trouble Shooting Queries.

For troubleshooting I got some SQL scripts from Microsoft support in the recent past. You can try to see if one of those will give some results. Then you can focus on the errors. Hope this will help you now, otherwise you might use them in future.
  1. --budgets assigned to invalid company
  2.  
  3. select * from BUDGETTRANSACTIONLINE l with (nolock)
  4.  
  5. join BUDGETTRANSACTIONHEADER h with (nolock) on l.BUDGETTRANSACTIONHEADER = h.RECID
  6.  
  7. where h.PRIMARYLEDGER not in (select recid from ledger)
  8.  
  9.  
  10. --bad category assigned to an account that has transactions
  11.  
  12. --Script start
  13.  
  14. select MA.MAINACCOUNTID, MA.NAME, L.NAME as CompanyID
  15.  
  16. from MAINACCOUNT MA with (nolock)
  17.  
  18. join DIMENSIONATTRIBUTEVALUE DAV with (nolock) on DAV.ENTITYINSTANCE = MA.RECID
  19.  
  20. join LEDGER L with (nolock) on L.CHARTOFACCOUNTS = MA.LEDGERCHARTOFACCOUNTS
  21.  
  22. where MA.ACCOUNTCATEGORYREF not in (select ACCOUNTCATEGORYREF from MAINACCOUNTCATEGORY)
  23.  
  24. and DAV.ISTOTAL = 0
  25.  
  26. and MA.ACCOUNTCATEGORYREF <> 0
  27.  
  28. and MA.MAINACCOUNTID in
  29.  
  30. (
  31.  
  32. select DISTINCT MA.MAINACCOUNTID from GENERALJOURNALACCOUNTENTRY GJAE with (nolock)
  33.  
  34. join DIMENSIONATTRIBUTEVALUECOMBINATION DAVC with (nolock) on DAVC.RECID = GJAE.LEDGERDIMENSION
  35.  
  36. join MAINACCOUNT MA with (nolock) on DAVC.MAINACCOUNT = MA.RECID
  37.  
  38. )
  39.  
  40. order by MA.MAINACCOUNTID
  41.  
  42. --Script end
  43.  
  44.  
  45. --transactions with an invalid company
  46.  
  47. select * from GeneralJournalEntry with (nolock)
  48.  
  49. where ledger not in (select distinct recid from ledger)
  50.  
  51.  
  52.  
  53. --transaction details with no associated transaction header information
  54.  
  55. select * from GeneralJournalAccountEntry with (nolock)
  56.  
  57. where GeneralJournalentry not in (select distinct RECID from GeneralJournalEntry with (nolock))
  58.  
  59.  
  60. --invalid dimension combinations
  61.  
  62. select * from GENERALJOURNALACCOUNTENTRY GJAE with (nolock)
  63.  
  64. where GJAE.LEDGERDIMENSION not in (select distinct VALUECOMBINATIONRECID from DIMENSIONATTRIBUTELEVELVALUEVIEW with (nolock))
  65.  
  66.  
  67. --Custom list financial dimension values
  68.  
  69. select * from DIMENSIONFINANCIALTAG with (nolock) where VALUE is NULL
  70.  
  71.  
  72.  
  73. --loops through all companies to identify null system dimensions
  74.  
  75. --Script start
  76.  
  77. DECLARE @TableName nvarchar(40)
  78.  
  79. DECLARE @SQL nvarchar(max)
  80.  
  81.  
  82. DECLARE tables_cursor CURSOR FAST_FORWARD
  83.  
  84. FOR
  85.  
  86. select distinct DA.VIEWNAME
  87.  
  88. from DIMENSIONATTRIBUTE DA
  89.  
  90. where DA.TYPE <> 3 and viewname <> 'DimensionFinancialTag'
  91.  
  92. order by DA.VIEWNAME
  93.  
  94.  
  95. OPEN tables_cursor
  96.  
  97. FETCH NEXT FROM tables_cursor INTO @TableName
  98.  
  99.  
  100. WHILE @@FETCH_STATUS = 0
  101.  
  102. BEGIN
  103.  
  104. PRINT 'Checking ' + @TableName + ' table...'
  105.  
  106. SELECT @SQL =
  107.  
  108. 'SELECT VALUE, NAME, ''' + @TableName + ''' as TableName FROM ' + @TableName + ' WHERE NAME='''''
  109.  
  110. EXEC (@SQL)
  111.  
  112. FETCH NEXT FROM tables_cursor INTO @TableName
  113.  
  114. END
  115.  
  116.  
  117. CLOSE tables_cursor
  118.  
  119. DEALLOCATE tables_cursor
  120.  
  121. --Script end

No comments:

Post a Comment