Compare aborted when reading constraints

nlalonde28nlalonde28 Posts: 3
edited May 27, 2010 2:19PM in SQL Compare Previous Versions
When running sql compare, the first database is registered fine, but when it starts to register the second database it fails when it gets to reading the constraints. I get the following error:

An unexpected null value was encountered while querying the database system tables. You may have insufficient permissions, or the database may be in an inconsistent state. you are recommended to use SQL Compare with dbo permissions. You can check the database is in a consistent state by running DBCC_CheckDB.

I don't have dbo permissions on the second database, but this hasn't been an issue in the past. Running CheckDB shows everything is fine.

Any suggestions?


  • Check to see if the database in question has any encrypted stored procedures. If so, then you will need dbo permissions.

    A quicker way, or if you are not sure after looking, would be to temporarily give dbo permissions and retry the compare. If it now works then you will have your answer.

    I hope that helps. Can you let me know if it has worked?
  • I did a select on the syscomments table to find anything with the Encrypted column set to true, and found nothing listed as encrypted.
  • In Management Studio, go to Object Explorer and then the Database in question and expand. Open the Programmability folder and then Stored Procedures. Ignore System Stored Procedures. Right-click on a stored procedure and select Properties. Under Options there is a field called Encrypted which will say either True or False. Check each one for encryption.
Sign In or Register to comment.