Solved

Copy values from one DB to another

Posted on 2014-11-10
1
98 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with Progress 4gl Rounding Function 6 55
calculate days away 11 58
Can a Trigger trigger a Trigger? 4 45
how to use ROW_NUMBER() correctly 8 39
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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.

740 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