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".
To compare database definitions. On the Tools menu, select SQL Server, and then click New Schema Comparison. Alternatively, right-click the TradeDev project in Solution Explorer, and select Schema Compare. The Schema Compare window opens, and Visual Studio automatically assigns it a name such as SqlSchemaCompare1 .
Without the use of third party tools, one way to compare table schemas using native T-SQL is to query the INFORMATION_SCHEMA. COLUMNS metadata and build a custom made procedure or logic that compares two tables. Another way to do this is to use the dynamic management function sys.
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
I found a work around that works for me.
http://www.richardmaxwell.name/blog/2011/3/2/work-around-isql100databaseencryptionkey-blocking-schema-com.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With