Object reference not set to an instance of an object

Documents SQL Server 2005 and 2008 databases.

Moderators: JonathanWatts, David Atkinson, Michelle Taylor

Object reference not set to an instance of an object

Postby jbold005 » Wed Aug 08, 2012 6:38 pm

Hi,

When trying to document a database I recieve an error message on a few tables: "object reference not set to an instance of an object". Then the documentation for that database is aborded...I can still document the database if i leave out those tables. However i would really like these tables in the documentation. Is there anyway to fix this issue?
jbold005
 
Posts: 2
Joined: Wed Aug 08, 2012 6:25 pm

Postby eddie davis » Fri Aug 10, 2012 2:30 pm

Thank you for your post into the forum and sorry that you have encountered a problem.

What exact full version numer of SQL Doc v2 are you using? You can obtain this information from the help menu ->About SQL Doc.

What version of SQL Server is the database you are attempting to document using?

If attempting to document a SQL 2012 database, the tables that generated the reported error, are they configured to use any of the new SQL 20012 features or data types?

Many Thanks
Eddie
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Postby jbold005 » Thu Aug 16, 2012 8:26 pm

The database is a SQL 2008 not R2 database and the SQL DOC version is 2.1.2.1
jbold005
 
Posts: 2
Joined: Wed Aug 08, 2012 6:25 pm

Postby eddie davis » Thu Aug 16, 2012 8:30 pm

Thank you for your reply.

Can you please provide a example table creation script for one or two of the tables that are causing you this problem?

Many Thanks
Eddie
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Postby pbezanson » Fri Sep 07, 2012 11:54 pm

Was this issue ever resolved? I'd be very intersted in the resolution.

I'm having the very same problem (SQL Server 2005, local OS: Windows 7, SQL Doc v2.1.2.1) and I'd like to know how to fix it. Unfortunately the SQL Doc log doesn't help me much but I'd be happy to make it available to anyone who thinks it might help them unravel this problem.

Thanks!
pbezanson
 
Posts: 6
Joined: Thu Sep 13, 2007 11:49 pm
Location: Portland, OR USA

Postby Brian Donahue » Mon Sep 10, 2012 10:06 am

Hello,

Unfortunately "object instance not set to an instance of an object" is a very generic programming error, which has thousands of potential causes and will never by nature be a bug that can be "fixed".

Typically in Red Gate SQL tools it means there is a bit of schema that depends on an object that cannot be read, either because it does not exist or you do not have permissions to it.

So as a first-look I'd try running the program using a SQL sysadmin account or at least one that have VIEW DEFINITION rights on the schema.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby pbezanson » Mon Sep 10, 2012 9:11 pm

Thanks for your response, Brian.

I always use an account with Sysadmin permissions to connect to the SQL Docs 2 project.

I've run DBCC Check on the database and found nothing wrong internally. If I remove the offending object from the list of objects to document, it stumbles over an object further down the list. If I remove that object and it stumbles over another object yet further down the list. I've tried this about 10 times and decided that even if it did finally succeed, the resulting documentation would be missing so many items as to be quite useless.

It would be nice if SQL Doc would tell me what it's expecting to find that isn't there. It must know if there is an "object reference" in the first place. It doesn't do that, however, nor does it write this information to its log. If I knew what it was stumbling over, I could fix it, but there are just too many objects in this database to guess.

Any ideas or strategies you may have for tracking down this "missing" object would be greatly appreciated.

Thanks again, Brian.
pbezanson
 
Posts: 6
Joined: Thu Sep 13, 2007 11:49 pm
Location: Portland, OR USA

Postby Brian Donahue » Tue Sep 11, 2012 10:06 am

Red Gate SQL Tools do not handle corrupt schema/schema it does not understand very well. My apologies for that.

My first step is usually to try debugging it, since the error handling built in to the software is not any help.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby stanori » Tue Sep 11, 2012 10:19 pm

Hi pbezanson,

We have opened a support ticket for you in regards to this issue. We will follow up with you shortly.

Best Regards,
Steve
_________________
Steve Tanori
Product Support
Red Gate Software Ltd.
866-997-0378
stanori
 
Posts: 84
Joined: Mon Apr 23, 2012 1:13 pm


Return to SQL Doc 2

Who is online

Users browsing this forum: No registered users and 0 guests