Solved

Copy values from one DB to another

Posted on 2014-11-10
1
101 Views
Last Modified: 2014-11-10
I have the following script to copy records from one database to another, problem is I get an error because the table and fields already exist on the target database, which is OK, I don't need to create them I only need the data to be copied from source DB to target DB

SELECT
   legal_entity_sk as legal_entity_sk,
   company_sk as Employerid,
   first_name as FirstNm,
   last_name as LastNm,
   middle_name as MiddleNm
INTO BDotSiskindImport.dbo.Users
FROM Siskind.dbo.legal_entity
GO
0
Comment
Question by:amucinobluedot
[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
1 Comment
 
LVL 70

Accepted Solution

by:
Qlemo earned 500 total points
ID: 40433203
In that case use an INSERT statement:
insert into BDotSiskindImport.dbo.Users
(Employerid, FirstNm, LastNm, MiddleNm)
select  legal_entity_sk, company_sk, first_name, last_name, middle_name
from  Siskind.dbo.legal_entity

Open in new window

0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard 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.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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