Database schema not being retrieved

jdlewisjdlewis Posts: 6
Have a database that will not retrieve and getting these details as errors. Any ideas? Thanks.

SQL Prompt could not retrieve the database schema:

RedGate.SqlPrompt.Engine.Cache.DatabaseRefreshException ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
at _12._21(SqlConnection )
at _12._1(_11 )
at RedGate.SQLCompare.Engine.Database.RegisterForSqlPrompt(ConnectionProperties connectionProperties, Options options, Boolean includeSystemObjects)
at _181._2(IAuthenticationTokenProvider )
--- End of inner exception stack trace ---
at _181._2(IAuthenticationTokenProvider )
at _181._1(IAuthenticationTokenProvider )
at _181.GetMetaData(IAuthenticationTokenProvider provider)
at _39._2(_33 , IAuthenticationTokenProvider , Boolean , EventHandler`1 , EventHandler`1 , EventHandler`1 , EventHandler`1 )

Comments

  • I've made the developers aware of this issue so hopefully they'll be a fix for this in the official release of SQL Prompt 3.7.
  • The db user has db_reader and db_writer access to the database.


    RedGate.SqlPrompt.Engine.Cache.DatabaseRefreshException ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
    at _12._21(SqlConnection )
    at _12._1(_11 )
    at RedGate.SQLCompare.Engine.Database.RegisterForSqlPrompt(ConnectionProperties connectionProperties, Options options, Boolean includeSystemObjects)
    at _181._2(IAuthenticationTokenProvider )
    --- End of inner exception stack trace ---
    at _181._2(IAuthenticationTokenProvider )
    at _181._1(IAuthenticationTokenProvider )
    at _181.GetMetaData(IAuthenticationTokenProvider provider)
    at _39._2(_33 , IAuthenticationTokenProvider , Boolean , EventHandler`1 , EventHandler`1 , EventHandler`1 , EventHandler`1 )
  • tanyatanya Posts: 269
    edited March 6, 2008 7:40PM
    Hello,

    What is the version of SQL Prompt that you get this error on?

    Thanks,
    Tanya
  • Matt_BMatt_B Posts: 12 Bronze 2
    I am getting the exact same message, using 3.6.0.109

    [edit]
    I've just seen a reference to a 3.7 patch at
    http://www.red-gate.com/messageboard/vi ... php?t=6289

    but can't find where to download it.
    Any hints?
  • Hello Matt,

    3.7 was a minor patch release and it can be obtained by mailing support@red-gate.com
    Alternatively, if you can pm your email id, I will mail it to you.

    Thanks,
    Tanya
  • I have the new version 3.7 and it is still giving me the same error message.

    Is there a new version coming out soon in Q1 2008 that will resolve this? If yes, when do you anticipate the release?

    Thank you.
  • tanyatanya Posts: 269
    edited March 6, 2008 7:35PM
    Hi,

    Sorry for the trouble you've been having. We have not really been able to replicate this issue in our test environment and so just a possible fix was committed for this issue in v3.7. But from your post looks like the fix clearly failed.
    Can you also please check the permissions on your database?
    We will try sorting this out in our v3.8 release that is currently scheduled to go live sometime around late April or early May.
    Meanwhile if you can give us any further information about the database that causes this error it might actually help us replicate the issue and thereby make it lot easier to fix the problem!

    Thanks,
    Tanya
  • Matt_BMatt_B Posts: 12 Bronze 2
    I tracked down this problem in my case to permissions. The DB that wasn't working for me has Read Only access, so the solution was at
    http://www.red-gate.com/SUPPORT/kb/KB200708000105.htm

    i.e. I needed GRANT VIEW DEFINITION on the DB
  • Thank you for updating us Matt.

    Regards,
    Tanya
  • Thanks Matt, this solved my issue.
Sign In or Register to comment.