An unexpected null value has been encountered while querying

Andrew HodgeAndrew Hodge Posts: 132
edited August 18, 2008 2:09PM in SQL Compare Previous Versions
Hi,

I have a problem when I perform a compare I am getting the error.

An unexpected null value has been encountered while querying the database system tables. Please make sure the database is in a consistent state by running DBCC CheckDB. If the problems persist contact support

I ran a checkdb and the output shows no errors

CHECKDB found 0 allocation errors and 0 consistency errors in database 'HCSSPLSTEST'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Andrew Hodge

Comments

  • Thanks for your post.

    Normally we see this kind of error due to some form of schema corruption. Often it turns out to be down to an object not having an owner, hence the NULL returned. However, this is not always the case.

    The first thing to check is that the account you are using has permissions to retrieve all the meta data for the schema. Using a sysadmin account should prove if this is the problem or not.

    You could then rerun the project and see where it fails. It should say the point at which the registration fails, e.g. "Reading Views". This might help you to track down the problem object.

    If this doesn't help, you can run a SQL Server Profiler Trace and catch the exact query that causes SQL Compare to fail (usually the last query in the trace for 'SQL Tools'). If you run this query manually through SQL Server, the results returned should contain enough information to find out which object has caused the problem. If you have not run a trace before, here is some information on how to do it: http://www.red-gate.com/supportcenter/G ... 000082.htm

    Feel free to send me the query and the results if you need me to investigate this further. A screenshot of the SQL Compare error would also be useful.
    Chris
  • I have full sa rights so I dont think this would be the issue. Will check the other things when I return to the office on friday.

    Many Thanks

    Andy H
Sign In or Register to comment.