I have an existing database with an indexed view that I would like to drop. Unfortunately, my build fails on the "Redgate DLM Automation Build" step with the following error:
<div><div><u><u>[19:20:44]</u></u><i><i>[Validating database state] </i>STARTING: Validating database state
</i></div></div><div><div><u><u>[19:20:44]</u></u><i><i>[Validating database state] </i>Starting: C:\Program Files (x86)\Red Gate\DLM Automation Suite 1\SC\SQLCompare.exe /include="Identical" /include="StaticData" /scripts1="C:\BuildAgent\temp\buildTmp\SQL CI\te21jk22.mca\db\state" /server2="np:\\.\pipe\LOCALDB#CD36AE7A\tsql\query" /database2="sqlCI_a74f6775-16ac-421a-93d5-774b63b9d099" /synchronize /tempInstance="Data Source=np:\\.\pipe\LOCALDB#CD36AE7A\tsql\query;Integrated Security=True" /options="DecryptPost2KEncryptedObjects,IgnoreFillFactor,IgnoreWhiteSpace,IncludeDependencies,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder,IgnoreDatabaseAndServerName,UseCompatibilityLevel,UseMigrationsV2"
</i></div></div><div><div><u><u>[19:20:44]</u></u><i><i>[Validating database state] </i>SQL Release: activated, edition: standard, serial number: *********
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:44]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>SQL Compare Command Line V11.6.0.1493
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:44]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>==============================================================================
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:44]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Copyright Copyright c 1999 - 2016 Red Gate Software Ltd
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:44]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;">[Validating database state]
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:44]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Registering data sources
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:46]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Creating mappings
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:46]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Comparing</i></div></div><div><div><u><u>[19:20:46]</u></u><i>[Validating database state]
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:46]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Applying Command Line Items</i></div></div><div><div><u><u>[19:20:46]</u></u><i>[Validating database state]
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:46]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Checking for identical databases
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:47]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Creating SQL</i></div></div><div><div><u><u>[19:20:48]</u></u><i><i>[Validating database state] </i>Inserting static data SQL into deployment script
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>Deploying changes (from DB1 to DB2)</i></div></div><div><div><u><u>[19:20:48]</u></u><i><i>[Validating database state] </i>Error: Synchronization of 'Scripts.state' and
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>'np:\\.\pipe\LOCALDB#CD36AE7A\tsql\query.sqlCI_a74f6775-16ac-421a-93d5-774b63b9d
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>099' failed: Cannot drop the index
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>'dbo.myIndexedView.myClusteredIndex', because it does not
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>exist or you do not have permission. Error executing the following SQL: DROP
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>INDEX [myClusteredIndex] ON [dbo].[myIndexedView]
</i><u style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><u>[19:20:48]</u></u><i style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, "Helvetica Neue", Arial, sans-serif;"><i>[Validating database state] </i>FINISHED WITH ERROR: Validating database state
</i></div></div>
I see a related issue from several years ago, but I haven't found any follow up:
https://forum.red-gate.com/discussion/20122/bug-in-drop-and-create-with-indexed-viewCan anyone help with this issue? At this point, I can't even remove the view manually, since my database builds without the view always fail.
Can anyone help with this issue? At this point, I can't even remove the view manually, since my database builds without the view always fail.