Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Use two database for select and insert

Posted on 2013-11-29
3
Medium Priority
?
329 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 1500 total points
ID: 39685979
INSERT INTO [abc].[dbo].[a] (id) SELECT id FROM [xyz].[dbo].[d]
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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, …
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

876 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