?
Solved

Moving Data Between Sql Server 2008 Instances

Posted on 2013-01-06
13
Medium Priority
?
317 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 252 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
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 500 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 1000 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 1000 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 500 total points
ID: 38751628
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 248 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 1000 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 1000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

777 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