August 20, 2009 at 12:45 pm
please ...................
Can anyone send me the script to Copy Data from one server to another server .
Thanks a lot
August 20, 2009 at 1:04 pm
Are you moving a specific table, or a whole database, or part of a table, or multiple tables? Will you be doing this once, or repeatedly? Are you trying to synchronize two databases?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 20, 2009 at 1:09 pm
Scripts like that are usually pretty specific to the database being copied. You might want to look at the Copy Database wizard for what you are trying to accomplish.
March 18, 2010 at 5:43 am
Hi,
The first thing that comes to mind is that you are asking someone to do your work for you.
The second thing that comes to mind is that the fastest way might to be use a backup and delete the objects you don't want. ++
Assuming that you just want the tables and views, I would start experimenting with the system views and some dynamic SQL. For example, the dynamic SQL would allow to scroll through sys.sysobjects to get you all of the tables and views [sys.sysobjects.type in ('U', 'V')]. This would allow you to use the SELECT INTO statement and transfer the data (or at least the table structure) across. Then there are the others DB-objects that you'd like to have: keys, constraints, indexes and so on.
If you are going across servers, you'll have to create a linked server, unless you restore a backup on the target server.
As an exercise, it's a great way to get to learn the various system views and how the DB-Objects are stored and interact. It's also a great way to put dynamic SQL to use. Finally, when you have written this wonderful script, you can post it up here for people like yourself as well as the rest of us.
I hope that helps. Learning by doing is a great way to learn. You just need enthusiasm and time.
March 18, 2010 at 4:57 pm
I recommend you check out how to use the import export tools in SSMS. You can also look at learning SSIS to perform the same task or you could purchase RedGate Data Compare.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 28, 2010 at 1:11 pm
The best and simple form to copy your data to another server would be to Backup the database and Restore it on the new server. Now if this process needs to run daily then I would Link the servers and create a SSIS package to drop the table and recreate the tables with the new data. Their are many way to accomplish this task.
March 29, 2010 at 6:57 am
For Complete data of the Database on server1 to Server2:
U should take the backup & Retore
For Some tables only:
Right click on the Server2 database & Select import data. Go through wizard.
March 31, 2010 at 10:12 pm
MS Publishing wizard can be used for generating Insert scripts as per tables and also for whole database.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply