Solved

Copy values from one DB to another

Posted on 2014-11-10
1
81 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
1 Comment
 
LVL 68

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now