views:

756

answers:

2

I am trying to do a Schema Compare in Visual Studio 2010 on some SQL Server 2008 databases. But I get the following error. What does it mean and how can I ignore?

An error was received from SQL Server while attempting to reverse engineer elements of type Microsoft.Data.Schema.Sql.SchemaModel.ISql100DatabaseEncryptionKey: The user does not have permission to perform this action.

Update: "Write Updates" does actually work. But I can't "Export to editor".

+6  A: 

I ran into the same problem. The only fix I found so far is to run the comparison as a user with the sysadmin Server Role. Even selecting to ignore Database Encryption Keys gives this error which seems broken to me. I filed a bug on connect: https://connect.microsoft.com/VisualStudio/feedback/details/552986/schema-compare-permission-error-for-database-encryption-keys-even-though-the-type-is-set-to-be-ignored

Nate Pinchot
Thank you for reporting this to Microsoft. It is troublesome when like me is having the database on a web host where I can not change the user roles.
jesperlind
Microsoft closed it as won't fix, however they did give some details on specific permissions that need to be granted to avoid this error (I haven't had a chance to try it yet) - check out the connect link above for details. I think they should have made it workable with a default setup and a login that has db_owner to the database you are working with but I guess they disagree.
Nate Pinchot
A: 

As mentioned "Write Updates" works and after you update target database you will be able to generate script using "Export To Editor".

samfromlv

related questions