Options

Unable to cast object error

lculleylculley Posts: 36
edited February 15, 2008 10:28AM in SQL Compare Previous Versions
Hi--

I'm using version 5 of sql compare and I am trying to compare two databases and I'm getting the following error:

"Unable to cast object of type 'System.DBNull' to type 'System.String'.

Even when I try to compare the same database to itself I get the same error. I am able to compare other databases.

Any ideas why I'm getting this?

Thanks,
Laura

Comments

  • Options
    This bug has been fixed in the latest version of SQL Compare (6.2). Essentially there were some system objects which were getting picked up by Compare if they were present in the database, and because they didn't return all of the information that a real object would, this error resulted.
    Software Developer
    Redgate Software
  • Options
    This bug has been fixed in the latest version of SQL Compare (6.2). Essentially there were some system objects which were getting picked up by Compare if they were present in the database, and because they didn't return all of the information that a real object would, this error resulted.

    I am still getting this error in SQL Compare 6.2.0.271. I think it is some sort of permissions thing because if I log in as SA it works. Is there a list of DB permissions somewhere needed to use this tool?
  • Options
    There's a Knowledge Base article explaining what permissions you should need for SQL Compare:

    https://www.red-gate.com/support/kb/KB200707000072.htm

    The error is caused by one of the queries we use to get information from the database returning a NULL value unexpectedly, which may happen if you have an object which you don't have permission to find out certain information about.

    If you're following the advice in the article and still having problems, please contact us again and I'll have a look into whether there are actually other permissions required to get all the information out of your database.
    Software Developer
    Redgate Software
  • Options
    That did it. Thanks for the point in the right direction.
Sign In or Register to comment.