Indexed Views - Wrong Synchronization by SQL Compare
Rajan
Posts: 2
Hello,
While trying to Synchronize two databases, the compare fails trying to synchronize indexed views, with the below errror message
"Cannot drop the index dbo.comp_view.comp_view_one_index" becasue it does not exist or you do not have permissions. The following SQL command caused the error:
DROP INDEX [comp_view_one_index] ON [dbo].[comp_view]"
I then checked th SQL Script [From Synchronization window] and in that the first statement removed the 'schema biding' for the view ' , which is basically a ALTER statement on the view without its indexes, so when it tries to delete the indexes from this view in the next statement it cannot find them.
When I remove the views from the Filter I can synchronize the database, I then have to re-synchronize this time with the views checked in the filter and it works, but this is extra work. Can someone on this forum offer some ideas on what I can do to get this working in one go?
Excerpt from the Syncronization.sql script:
PRINT N'Removing schema binding from [dbo].[comp_view]'
ALTER view [dbo].[comp_view] .......
....
...
PRINT N'Dropping index [comp_view_one_index] from [dbo].[comp_view]'
GO
DROP INDEX [comp_view_one_index] ON [dbo].[comp_view]
.....
While trying to Synchronize two databases, the compare fails trying to synchronize indexed views, with the below errror message
"Cannot drop the index dbo.comp_view.comp_view_one_index" becasue it does not exist or you do not have permissions. The following SQL command caused the error:
DROP INDEX [comp_view_one_index] ON [dbo].[comp_view]"
I then checked th SQL Script [From Synchronization window] and in that the first statement removed the 'schema biding' for the view ' , which is basically a ALTER statement on the view without its indexes, so when it tries to delete the indexes from this view in the next statement it cannot find them.
When I remove the views from the Filter I can synchronize the database, I then have to re-synchronize this time with the views checked in the filter and it works, but this is extra work. Can someone on this forum offer some ideas on what I can do to get this working in one go?
Excerpt from the Syncronization.sql script:
PRINT N'Removing schema binding from [dbo].[comp_view]'
ALTER view [dbo].[comp_view] .......
....
...
PRINT N'Dropping index [comp_view_one_index] from [dbo].[comp_view]'
GO
DROP INDEX [comp_view_one_index] ON [dbo].[comp_view]
.....
Comments
Redgate Software