Options

Indexed Views - Wrong Synchronization by SQL Compare

RajanRajan Posts: 2
edited April 29, 2008 7:03AM in SQL Compare Previous Versions
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]
.....

Comments

  • Options
    Michelle TMichelle T Posts: 566 Gold 1
    Which version of SQL Compare are you using? We used to have a problem with this, but we think we fixed it by 6.2.0.271 (the current released version). If it's happening with the latest version we'd be interested in looking into it further.
    Software Developer
    Redgate Software
Sign In or Register to comment.