Solved

Use two database for select and insert

Posted on 2013-11-29
3
305 Views
Last Modified: 2013-11-29
Dear Experts,
I have two different databases. need to connect one to get data and second to insert.

Insert into abc.dbo.a(ID)
Select id from xyz.dbo.d(id)

How i could execute this task please guide
0
Comment
Question by:Mehram
  • 2
3 Comments
 
LVL 9

Expert Comment

by:guswebb
ID: 39685952
SELECT [xyz].[dbo].[d].[id] INTO [abc].[dbo].[a]
0
 

Author Comment

by:Mehram
ID: 39685966
Sir, the both table already exist. Into will create another table I need make join between both databases to get result and insert into the particular table.
0
 
LVL 9

Accepted Solution

by:
guswebb earned 500 total points
ID: 39685979
INSERT INTO [abc].[dbo].[a] (id) SELECT id FROM [xyz].[dbo].[d]
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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