Solved

Copy a table from one database to another

Posted on 2006-06-22
3
177 Views
Last Modified: 2012-08-14
Evening experts.

All I need to do is copy 1 remote table from a backup database, to another database on the same sql server.  Table has to include the data from the backup.

Everything I have tried keeps trying to copy every table, with all data.  Simply just need a copy and paste like situation. There are no triggers, indexs etc, just the table structure, the keys, and data.

Thanks.
0
Comment
Question by:moonrisesystems
[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
3 Comments
 
LVL 21

Accepted Solution

by:
Yurich earned 125 total points
ID: 16965699
standard backup/restore routine will try to do it as a whole database. what you can try to do is:

1. export your table using DTS from your database and then import it where you need to get new data.

2. restore database under a different name and then run a query to insert everything from that table and that database into your current table, of the current database.

i'm not sure which one would be easier for you, but they're both not bad ;)

good luck,
yurich
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16965715
Another approach:

Use DestinationDatabase

Select *
Into DestinationTable
From SourceDatabase.dbo.SourceTable

You will have to add the indexes/constraints after that is complete.
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16965742


If this table is the same table from an "older" backup copy are you worried about duplicates, are you trying to replace data?

If not, AC's solution is the easiest since its on the same server.

0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

688 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