When running Schema Compare and selecting the Generate Script Wizard, the process fails if there is a comment line directly above a CREATE PROCEDURE
statement.
If the comment is moved (for example, above a blank line or between other statements), the Generate Script completes successfully.
When the issue occurs, the following error is displayed:
System.Exception: The CREATE keyword is not found
Stack trace:
at Quest.Schema.MSSQL.Parser.ScriptUtilsMSSQL.ReplaceCreateToAlter(String body)
at Quest.Schema.MSSQL.Sync.Workers.Sync.SyncWorkerBodyObject.<GenerateActionsAlter>d__4.MoveNext()
at Quest.Schema.MSSQL.Sync.Workers.Sync.SyncManager.<generateActionsAlter>d__11.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Quest.Schema.MSSQL.Sync.SyncLegacy.Sync.GenerateScript(ICallBack callBack)
at Quest.Schema.MSSQL.Sync.SyncLegacy.Sync.Process(SelectedObjectCollection selectedObjects, ICallBack callback)
at Quest.Schema.MSSQL.Sync.SynchronizerModule.RunProcess(ICallBack callback, OnionContainer container, ActionManager manager)
at Quest.Schema.Common.OnionMechanism.Modules.Module.RunAsync(ICallBack callback, OnionContainer container, Object[] args)
The Generate Script Wizard engine parses the script incorrectly when a comment precedes an CREATE PROCEDURE
object declaration.
It is identified by a defect IMTDS-3727.
Until the defect is fixed, apply the following workaround:
CREATE PROCEDURE
statements.CREATE PROCEDURE
.