• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

Use two database for select and insert

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
Mehram
Asked:
Mehram
  • 2
1 Solution
 
guswebbCommented:
SELECT [xyz].[dbo].[d].[id] INTO [abc].[dbo].[a]
0
 
MehramAuthor Commented:
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
 
guswebbCommented:
INSERT INTO [abc].[dbo].[a] (id) SELECT id FROM [xyz].[dbo].[d]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now