Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Moving data from one SQL database to another

Posted on 2007-10-05
10
Medium Priority
?
165 Views
Last Modified: 2010-03-19
I need to move data from one SQL database to another, I am using SQL Server 2005 but dont know much about it. I can run scripts if someone provides with the code. My knowledge so far has allowed me to setup a new database, run a script to create the tables and set security for the db, and thats Im afraid.

An "SQL for dummies" type explanation would be very much appreciated.




0
Comment
Question by:3can
  • 4
  • 3
  • 3
10 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20020221
Option1 : using "Copy database wizard"
Right click on the database ->Tasks ->Copy database wizard
Now you just need to enter the user credentials and the SQL server instance to which you need to attach this db.
0
 
LVL 14

Expert Comment

by:Jai S
ID: 20020225
open management studio(SSMS)
--> select the database --> right click --> Export
the export wizard will be opened...
click next
select the source database (from which you want to export your data)
next
select the destination database(to where you want to export)
select the tables you want to export...
complete the wizard...
you data are transfered.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20020236
Make a copy of a database using BACKUP and RESTORE
This example uses both the BACKUP and RESTORE statements to make a copy of the Northwind database. The MOVE statement causes the data and log file to be restored to the specified locations. The RESTORE FILELISTONLY statement is used to determine the number and names of the files in the database being restored. The new copy of the database is named TestDB. For more information, see RESTORE FILELISTONLY.

Step1.

BACKUP DATABASE Northwind
   TO DISK = 'c:\Northwind.bak'  

Step2.
--now copy that Backupfile and paste at the target machine


Step3.
RESTORE FILELISTONLY
   FROM DISK = 'c:\Northwind.bak'
-- When you run the above statement, it will give ou the logical names, make a note of those names

Step4.
RESTORE DATABASE TestDB
   FROM DISK = 'c:\Northwind.bak'
   WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',      --- 'Northwind' is the logical name of the MDF file
   MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'            -- 'Northwind_Log' is the logical name of the LDF file

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:3can
ID: 20020277
Sorry forgot mention I am using:

SQL Server management studio express.

I also only need to copy certian categories from one database.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20020287
oops , i thought you want 2 move the entire db , In case you just need to move few tables, you must follow the instructions "JaiGanesh" mentioned.
0
 
LVL 14

Expert Comment

by:Jai S
ID: 20020304
open management studio(SSMS)
--> select the database --> right click --> Export
the export wizard will be opened...
click next
select the source database (from which you want to export your data)
next
select the destination database(to where you want to export)
select the tables you want to export...
complete the wizard...
you data are transfered.

:-)))
0
 

Author Comment

by:3can
ID: 20020373
JaiGanesh

Dont know if I am being dumb but when I right on the db I only get the following options:
New Database
New Query
Script Database
Tasks
Rename
Delete
Refresh
Properties

When browsing help I found the following command:

bcp Utility

bcp AdventureWorks.Sales.Currency out "Currency Types.dat"

Does this sound like a command I could ?

??


0
 
LVL 14

Expert Comment

by:Jai S
ID: 20020387
under tasks --> you have EXPORT DATA
(i must have been more clear)
0
 

Author Comment

by:3can
ID: 20020406
From Taksk it goes:

detach
shrink
restore
backup
generate scripts
0
 
LVL 14

Accepted Solution

by:
Jai S earned 2000 total points
ID: 20020427
iam afraid
SQL Server management studio express
does not have the option...
i ma using SSMS - Developer and I have the menus listed...around 10 of them
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

571 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