How can you read table data from your Sql backups.

Automate and integrate using the SQL comparison API

Moderators: Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

How can you read table data from your Sql backups.

Postby zaliis » Wed Mar 19, 2014 5:18 am

When I attempt to create an instance of the BackupConnection using the default ctor I get the following error message

SQL Backup Reader may not be called from user code

I also tried using RegisterForDataCompare and opening the BackupConnection and that returns the exception

No filenames specified.


I need to do a schema and data compare between two SQL Server 2008 database backups. If I detect a schema or data difference I need to output the tables in the target database to a Sql CE sdf.

I have the code working to output the database schema I just need to know how to read all records from each table in the backup using the SDK.

I think I can also accomplish what I need if I can compare a sql backup to an empty folder. Then I could read the data I need from the table differences object. But every time I try that type of compare there are no table differences.


Thanks in advance.
zaliis
 
Posts: 8
Joined: Tue Mar 18, 2014 10:05 pm

Postby Brian Donahue » Thu Mar 20, 2014 12:50 pm

Hello,

You may be creating an object that does not have a constructor meant for public use. If you want to compare data in a backup, here is an example.

http://sdk.red-gate.com/index.php/Compa ... e_database

Hopefully this is useful for you.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Comparison SDK 10

Who is online

Users browsing this forum: No registered users and 0 guests