SQL Data Compare

Latest version: 10.0

SQL Data Compare

Knowledge Base

Exception thrown by db reader 1

Category: Troubleshooting & error messages
Date: 16 Jul 2009
Product: SQL Data Compare
Versions: 5, 6, 7
Either before or during the comparison of data in your tables, the error message "Exception thrown by db reader 1" or "Exception thrown by db reader 2" may occur.

When the error "exception thrown by db reader..." is displayed during a comparison, it means that an exception occurred whilst reading data from the SQL Server table. If the error mentions "db reader 1", then there is a problem reading from a table in the "left-hand" database, while "db reader 2" refers to the "right-hand" database.

The most common cause of this error is an invalid WHERE clause set on the table.

The table you need to check will be the one reported in the error, e.g. Comparing [dbo].[table_1] to [dbo].[table_1]. If you are confident the where clause is correct, you may wish to try surrounding the clause in parenthesis. E.g. (id > 100)

Network and SQL Server issues can also cause this error -- for instance of the SQL Server process is terminated by a server restart. On a few occasions, disabling connection pooling has solved the problem, when it is related to a connection to the SQL Server.

To disable connection pooling, enter the server name into the "Server" textbox by hand and follow it with a semicolon and "Pooling=false". For example: MyServer;Pooling=false

We have a code change request open at the moment to return a better error message when this happens, possibly the actual SQL Error, which would be better for diagnosing the issue.

Update: SQL Data Compare 8.x will now return the SQL Server error.

Document ID: KB200903000364 Keywords: SQL,Data,Compare,db,reader,1,2

Was this article helpful?

Search support
Forums

SQL Data Compare

all SQL products

all products