Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is ISql100DatabaseEncryptionKey blocking Schema Compare

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".

like image 523
jesperlind Avatar asked Apr 20 '10 19:04

jesperlind


People also ask

How do I compare two db schemas?

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 .

How do I compare two table schemas in SQL Server?

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.


2 Answers

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

like image 129
Nate Pinchot Avatar answered Oct 26 '22 23:10

Nate Pinchot


I found a work around that works for me.

http://www.richardmaxwell.name/blog/2011/3/2/work-around-isql100databaseencryptionkey-blocking-schema-com.html

like image 44
Richard Avatar answered Oct 27 '22 00:10

Richard