Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Database copying dynamically

Author  Topic 

BryanBurroughs
Starting Member

8 Posts

Posted - 2010-04-06 : 14:14:46
I'm not sure which section this should go in, so please forgive me if this is in the wrong section.

I have a Sql2005Express database that needs to be synched up with a Sql2005 database. But, I'd like to be able to dynamically specify the server at run-time. I'd also like to limit the records that are populated in the mobile database. The mobile database is NOT identical to the main one, though they are very very similar. As well, for security reasons, I will likely have to clear the mobile database's records after uploading the changes to the main database.

At this point, I am trying to copy only the records of interest over to the mobile database. Uploading data is already handled via a .NET program. What would be the best way to attack this situation? The "perfect" solution to me at this point is to run a stored procedure on the mobile database which will then copy the data from the main database.

For reference, I'll be using a pre-specified Windows user to authenticate to the mobile database every single time. The work-flow will be as follows:
1) download the data from the main to the mobile
2) offline, make changes to the data in the mobile database
3) upload changed data to the main database using a .NET program
4) clear the mobile database

Thanks in advance.

dtecmeister
Starting Member

5 Posts

Posted - 2010-05-13 : 22:54:12
If you insure timestamp columns on all the tables, it's a simple series of update select statements. One for each table you want to sync. You may want to add a file or table on the mobile database to store the timestamp of the latest sync/upload so you know what to compare the timestamps to.
Go to Top of Page
   

- Advertisement -