Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Copying  data from one table to another

Posted on 2008-06-25
6
Medium Priority
?
699 Views
Last Modified: 2008-06-25
What is the best way to copy data from one table in a BD to another table in other DB.
the tables are not the same tables, so I will need to specify where the data from the source will go in the  new DB and in what field.

In my SQL Managment I have noth DB connected
0
Comment
Question by:Ennio
[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
6 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 21865320
insert into sometable(fieldname1, fieldname2, fieldname3)
select fieldname1, fieldname2, fieldname3)
from someothertable
where somecriteria
0
 
LVL 1

Author Comment

by:Ennio
ID: 21865412
But for example
someothertable is in another server not in the same server as sometable.
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 800 total points
ID: 21865445
Ahh...you failed to mention that in your question.  :)  You're going to need to setup a linked server.

http://msdn.microsoft.com/en-us/library/aa213778(SQL.80).aspx

http://www.databasejournal.com/features/mssql/article.php/3085211
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 200 total points
ID: 21865454
Hello Ennio,

you have to create a linked server first, then you can use the following syntax

insert into sometable(fieldname1, fieldname2, fieldname3)
select fieldname1, fieldname2, fieldname3)
from LinkedServerName.dbName..someothertable
where somecriteria


GOD Bless,
Aneesh R.
0
 
LVL 8

Accepted Solution

by:
DenverRick earned 1000 total points
ID: 21865702
Use the Export/Import function in SQL 2000 or 2005 they are both similar.  After creating the export and imports and setting mappings of the different fields you can save them to a Data Transformation Package and run them anytime you need to.
0
 
LVL 1

Author Comment

by:Ennio
ID: 21865868
Using the export/import function worked great, and it was simple
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

636 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