comparing two tables

I have two identical table ie all the columns are identical and one of the datatype is Text, one is varchar(255) and the rest are int.
Lets say the table name is ‘AAAAA’.
Table AAAAA was processed and backed up earlier this month.
Both the tables were storing data and now the second table is only storing data.
I need to find unmatching records from the second table (BBBBB) which is storing data right now and add those records to Table AAAAA.

Your help will be highly appreciated. I tried to use ‘EXCEPT’ but it does not support text datatype.

  • How to make XML values comma separated using XPath, XQuery in SQL Server
  • Create a one to many relationship using SQL Server
  • How to get a value from stored procedure
  • how to find particular word from one table which is present in table 2
  • Rounding Datetime to nearest 15 minutes in SQL Server
  • SQL find Customers that haven't been contacted in the past 45 days
  • I’m using SQL Server 2005.

    4 Solutions collect form web for “comparing two tables”

    Get a copy of redgate’s SQL Data Compare.

    If you’re using Visual Studio 2010 Premium or above you can use the data compare tool.

    Answer to marks question: The Primary key is the combination of 6 fiels/columns.

    Can’t you just do a left join using your primary key fields the rows with null values for your ‘AAAAAA’ table will be null.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.