How do I Compare data in #temp tables

hafhaf Posts: 2

I would like to know it if is possible to compare the data stored in two temporary tables.

It seems to be that it should be possible because when I tell "Sql Data compare 9" that I want to compare tables inside the "tempDB" database where #temp tables are stored, the tables are detected along with all the columns and everything. It is also possible to specify the custom keys just like if the tables would had been regular tables. The tables have very strange names however.
The problem is that when I push the "Compare now" button, a popup with the following text shows:


When I copy the SELECT-command that caused the error from the popup window to Management studio and try to execute it, IT WORKS AS JUST EXPECTED!!

So how come DataCompare 9 cannot run the Select command when I can do it myself in management studio??

Please help we with this urgent matter!
The temporary tables are filled with data coming from stored procedures used to generate reports, and I have a whole buch of reports I need to compare! Since it is not possible (?) to compare resultsets from SP's directly, I used "OPENQUERY" to insert the resultsets into #temp tables Im hoping I can compare using your excellent software!


  • Hi Haf,

    At the moment you cannot compare temp tables as they are system objects not user objects. SQL Data Compare specifically makes sure that the table type is user and not system.

    You could try creating a few of those tables and comparing those?

    Siân Williams
    Red Gate Software
    Tel: 0800 169 7433
    [email protected]
Sign In or Register to comment.