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
MehramAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
guswebbConnect With a Mentor Commented:
INSERT INTO [abc].[dbo].[a] (id) SELECT id FROM [xyz].[dbo].[d]
0
 
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
All Courses

From novice to tech pro — start learning today.