Solved

Moving Data Between Sql Server 2008 Instances

Posted on 2013-01-06
13
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +3
13 Comments
 
LVL 17

Assisted Solution

by:Kent Dyer
Kent Dyer earned 63 total points
ID: 38749737
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
ID: 38749988
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
ID: 38750365
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 125 total points
ID: 38750389
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
ID: 38750426
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
ID: 38750514
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
 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 250 total points
ID: 38751592
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 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 125 total points
ID: 38751628
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 62 total points
ID: 38751759
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
ID: 38751939
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:Scott Pletcher
ID: 38752103
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
ID: 38752802
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
ID: 38754250
Really good discussion.  Thanks!!
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help Required 3 117
Whats wrong in this query - Select * from tableA,tableA 11 53
Text file into sql server 5 42
shrink table after huge delete 2 28
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

762 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