Undocumented error message

GSSGSS Posts: 10 Bronze 1
I'm doing a compare of two databases that should be generally the same.  One Azure SQL, the other SQL Server.  But the comparison fails with the error;

 expecting "resource", found 'DATA'
 
 That is all it says.  I can't find anything that explains the error or how I might fix it.
 
 Anyone know?  Thanks.

Answers

  • Russell DRussell D Posts: 1,324 Diamond 5
    Can you show us the error? Does the verbose log file contain anything else (https://documentation.red-gate.com/sc13/getting-more-from-sql-compare/logging-and-log-files)? 
    Have you visited our Help Centre?
  • Alex BAlex B Posts: 1,151 Diamond 4
    Hi @GSS,

    You might also try comparing the source to itself and the target to itself to see which one fails, this may also give you more information as to the object causing the problem in question.

    You might also be able to use SQL Search to look for the text "Data" to see if you can find the offending object.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • GSSGSS Posts: 10 Bronze 1
    Thanks for your reply.  See below;


    Clicking "More details" just shows the same error with no further details.

    In the log file the relevant section seems to be;

    113:58:01.952|Info   |SQL Compare         |13 |Sending 1 event:
    [
      {
        "eventType": "database.comparison.failed",
        "headers": {
          "productId": "sql-compare",
          "productVersion": "13.7.7.10021",
          "eventUuid": "3dfc753d-2cb0-45b4-83c0-14dbbbf1d04c",
          "usageUserId": "eec3d61d-b7af-4f3b-9566-662108fd3ab3",
          "sessionUuid": "4894d79a-3b02-49fc-b17f-0bcdb5d23cbd",
          "createdTimeUtc": "2019-05-20T12:58:01Z"
        },
        "payload": {
          "exception": {
            "type": "MismatchedTokenException",
            "stackTrace": "   at RedGate.SQLCompare.ASTParser.StructureParser.RecoverToNextStatement(Exception e)   at RedGate.SQLCompare.ASTParser.StructureParser.statementFirstInBatch()   at RedGate.SQLCompare.ASTParser.StructureParser.statementBatch()   at RedGate.SQLCompare.ASTParser.StructureParser.expr()   at RedGate.SQLCompare.Engine.Utils.GetAst(TextReader script, Boolean quotedIdentifiers)   at RedGate.SQLCompare.Engine.DatabaseMapper.FixTextObjectDefinition(ITextObject obj)   at RedGate.SQLCompare.Engine.DatabaseMapper.MapStoredProcedure(StoredProcedure sp, IDictionary`2 spMappingsToAdd)   at RedGate.SQLCompare.Engine.DatabaseMapper.MapDatabase(SqlCompareOwnerMappings origMappings)   at RedGate.SQLCompare.Engine.SqlCompareOwnerMappings.MapDatabase(Boolean first, StatusEventHandler status)   at RedGate.SQLCompare.Engine.SqlCompareOwnerMappings.MapDatabase(Boolean first)   at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<>c__DisplayClass11_0.<GetMappings>b__2()   at System.Threading.Tasks.Task.Execute()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<>c__DisplayClass11_0.<<GetMappings>b__1>d.MoveNext()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at RedGate.SqlServer.Comparison.Shared.UI.Dialogs.Mappings.ViewModel.StatusEventArgsHandler.<WrapShuCancellableOperation>d__4`1.MoveNext()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<GetMappings>d__11.MoveNext()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at RedGate.SqlServer.Comparison.Shared.UI.Extensions.ProgressExtensions.<HandleErrorsIn>d__3`1.MoveNext()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<CompareNowWithFur>d__10.MoveNext()--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at FurHelper.FurUtils.<RunOperationWithFur>d__1`1.MoveNext()",
            "errorNumber": 0
          }
        }
      }
    ]
    13:58:02.000|Info   |SQL Compare         |13 |Usage reporting request made to https://featureusage.red-gate.com/v1/usageevents
      Number of submitted usage events = 1
      HTTP status code = 204 NoContent
      Response body =
    13:58:10.102|Error  |Engine Service      |1  |Comparison failed
    System.AggregateException: One or more errors occurred. ---> antlr.MismatchedTokenException: expecting "resource", found 'DATA'
       at RedGate.SQLCompare.ASTParser.StructureParser.RecoverToNextStatement(Exception e)
       at RedGate.SQLCompare.ASTParser.StructureParser.statementFirstInBatch()
       at RedGate.SQLCompare.ASTParser.StructureParser.statementBatch()
       at RedGate.SQLCompare.ASTParser.StructureParser.expr()
       at RedGate.SQLCompare.Engine.Utils.GetAst(TextReader script, Boolean quotedIdentifiers)
       at RedGate.SQLCompare.Engine.DatabaseMapper.FixTextObjectDefinition(ITextObject obj)
       at RedGate.SQLCompare.Engine.DatabaseMapper.MapStoredProcedure(StoredProcedure sp, IDictionary`2 spMappingsToAdd)
       at RedGate.SQLCompare.Engine.DatabaseMapper.MapDatabase(SqlCompareOwnerMappings origMappings)
       at RedGate.SQLCompare.Engine.SqlCompareOwnerMappings.MapDatabase(Boolean first, StatusEventHandler status)
       at RedGate.SQLCompare.Engine.SqlCompareOwnerMappings.MapDatabase(Boolean first)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<>c__DisplayClass11_0.<GetMappings>b__2()
       at System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<>c__DisplayClass11_0.<<GetMappings>b__1>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Shared.UI.Dialogs.Mappings.ViewModel.StatusEventArgsHandler.<WrapShuCancellableOperation>d__4`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<GetMappings>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Shared.UI.Extensions.ProgressExtensions.<HandleErrorsIn>d__3`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineComparisonService.<CompareNowWithFur>d__10.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at FurHelper.FurUtils.<RunOperationWithFur>d__1`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineService.<DoComparison>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlServer.Comparison.Shared.UI.Dialogs.Progress.ViewModel.ProgressDialogViewModel`1.<SetTask>d__40.MoveNext()
       at RedGate.SqlServer.Comparison.Shared.UI.Dialogs.Progress.ViewModel.ProgressDialogViewModel`1.<SetTask>d__40.MoveNext()
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at RedGate.SqlServer.Comparison.Shared.UI.Services.Progress.ProgressDialogRunner.RunProgressDialog[TResult](Func`3 createTask, IntPtr hwndParent, ISetting`1 closeOnCompletion)
       at RedGate.SqlServer.Comparison.Schema.UI.Services.SchemaEngineService.RunPopulationAndComparison(IWin32Window parent, IProject project, Boolean forceReregistration, Boolean isDifferentProject)
    ---> (Inner Exception #0) line 39:21: expecting "resource", found 'DATA'<---



  • Alex BAlex B Posts: 1,151 Diamond 4
    Hi @GSS,

    Yeah, that's a parser issue, likely in a stored procedure.  Somewhere it's expecting to see resource but instead it has DATA.

    As I said above, I think you can find this by comparing the source to itself and the target to itself to see which one fails (which may also give you more information as to the object causing the problem) but then also use SQL Search to search for the text "DATA" to find the object that way too.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.