Sql-server – tablediff on two similar tables

migrationsql server

We're doing a SQL Server 2005 upgrade to 2008 and one of the things that we're also changing at the same time is we're changing all varchar fields to nvarchar (don't ask me why).

After importing the data to the new 2008 database, I want to compare and validate the data. So I tried using the tablediff program that comes with SQL Server but it can't compare the two schemas due to the varchar/nvarchar difference.

This is the error I get:

Table [db1].[dbo].[table1] on server1 and Table [db2].[dbo].[table2] on server2 have different schemas and cannot be compared.

Is there a quick workaround to do this? If not, anyone have any suggestions that are free?

As an aside, it would be great if instead of comparing the entire table, I can compare only the rows with a certain condition (ie. where dates > 2009)

Best Answer

If you want a utility to do this for you (and you can do it in a 14 day evaluation, or don't mind spending some money) Red Gate Software have excellent utilities SQL Compare (for schemas) and SQL Data Compare (for data).

(Thanks to squillman for pointing out I'd linked the wrong one!)

Related Topic