Solved

Moving Data Between Sql Server 2008 Instances

Posted on 2013-01-06
13
316 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article I will describe the Detach & Attach 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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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