Solved

Moving Data Between Sql Server 2008 Instances

Posted on 2013-01-06
13
308 Views
Last Modified: 2013-01-08
I have a sql server database on my server and another one on my laptop that I use to go out and time races (5ks, nordic ski meets, etc),  Given the oftentimes lack of internet connectivity I have to move the data from the server to the laptop, go time the race, and then move it back to the server with the new results.  To move the data I simply copy the data files from the data folder to dropbox or a jump drive and then go get them...  Is there a better way?

Years ago I tried to use replication with sql server 2000 but, not being a db professional, I just couldn't get it right.  My next effort will be to write a script that will identify new data and write that into the db via a web page.  Before I do that I am wondering if there is a better approach for a hack like myself.
0
Comment
Question by:Bob Schneider
  • 4
  • 3
  • 2
  • +3
13 Comments
 
LVL 17

Assisted Solution

by:Kent Dyer
Kent Dyer earned 63 total points
Comment Utility
Look at replication partners and setup in BOL.

Should not need to script unless needed as the replication partnership should handle changed data..

HTH,

Kent
0
 
LVL 12

Expert Comment

by:Saurabh Bhadauria
Comment Utility
let me know in details about your data and all...

how many tables you need to sync between server and laptops ?
How many new record you need to push to server from laptop every time ?

Thanks,
Saurabh
0
 

Author Comment

by:Bob Schneider
Comment Utility
Could be as many as 800 records that need to be adjusted (note: not new records for the most part, but records that need to be modified).  I will look at replication partners...not sure what BOL is but I will figure it out.
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 125 total points
Comment Utility
I use Red Gate SQL Data Compare to compare data: http://www.red-gate.com/products/sql-development/sql-data-compare/
0
 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 250 total points
Comment Utility
BOL = Books Online - the SQL Server name for Help.

Because it is kinda random and not huge datasets, I am not so sure you need full replication. It sounds like one way traffic to me being field results >> Server

How do you access your server when back on the network ?

If you use your own SSMS, then you can do things like COPY and PASTE rows much the same as you would do in excel.

Open your own table (right click the table and open), select the rows and copy, then open the network database (within SSMS) and open the network table and then paste.

Or, if you can, open a linked server and run an insert statement.

Or, you could use database copy wizard and then import to the server.

Or, do what you are currently doing, copy your database to the Network instance and attach then do the updates to the "live" repository (it isnt really a bad solution from what it sounds like)

Some of it depends on your table structures (if updates are needed or just inserts) and how many different tables are really involved...

It is also very dependant on how you access / the connection to the network instance of SQL Server.

The important part of the puzzle is to script what ever you are doing, so it is "easy" next time.
0
 

Author Comment

by:Bob Schneider
Comment Utility
Because of the fact that there are changes being made to multiple tables I am not sure the copy-n-paste solution would work.  I agree that a full replication solution might be too much.  What I am doing now is not bad from most perspectives but what happens is that, when I move the db to my laptop to time an event, any changes made on the server until I re-load the database (ie: by coaches of teams in an upcoming race or by individual entrants in an upcoming race) are lost.  As a result I have to close the server during that time to avoid any further changes being made.  That is pretty inconvenient to my upcoming races.

I think the best thing to do is to write a script in my vb6 app that creates a text file of all changes made during the event and then use my web site to modify the server database.

Given this information, does it sound like I am on the right track or am I missing something?
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 250 total points
Comment Utility
OK, if there are lots of other tables involved, and it is not a discrete snapshot, and it is two-way traffic, then replication might not be such a bad choice...

Depends a bit on Server v Web v Laptop.  Not exactly sure of what the app environment is doing. And if in fact it is always two way (ie teams might be via Web to Server then needs to make it out to Laptop, but the only data from the "field" are the actual results).

Still, it sounds like your laptop is pretty much "untethered" for some of the time... So, writing a script (either SQL or VB) to export changes since data load is easy enough and might be the best solution for you.

Best to sit down and list exactly what changes are going where and when... If the same tables are involved in two way updates, then replication does handle "the latest changes" pretty well. If individual tables have one way traffic (albeit a few tables) then a script can be an easy to define process and easy to create data flow.
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 125 total points
Comment Utility
0
 
LVL 69

Assisted Solution

by:ScottPletcher
ScottPletcher earned 62 total points
Comment Utility
Redgate's tools are excellent, but I don't think  they have a free version of compare.

You could instead use MS's free program, "tablediff.exe".  That would allow you to generate statements to put the data back in sync.

It's a line-command utility, so it's a pain to get used to, but once you do it's reasonably good, and it's fast for small amounts of data, as in your case.

You could then leave the server db live, and just merge in your differences.
0
 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 250 total points
Comment Utility
Well, you could also use Change Tracking - that will identify what rows have changed and can be easily retrieved (on both Express and Server).

http://msdn.microsoft.com/en-us/library/bb933875(v=sql.100).aspx
0
 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
I guess CDC could be available on the laptop if you're running Developer Edition.

It will require on-going administration, however, and could take up a lot of disk space if not properly maintained.
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 250 total points
Comment Utility
Nope, not saying CDC ... Saying Change Tracking...

Look under "replication" to see features supported  (Note SQL Sever Change Tracking)

Then lookunder Datawarehouse Scal and Performance (note CDC)
0
 

Author Closing Comment

by:Bob Schneider
Comment Utility
Really good discussion.  Thanks!!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now