M_M
M_M

Reputation: 501

insert database from view located in a different server

I want to feed my database with data that i retrieve from a view that is located in a different server.

previously I inserted data in a table that's located in the same server as the view and I used this script :

   use databasename
   Go
   SET ANSI_NULLS ON
   GO
   INSERT INTO table1
   SELECT * FROM view1

but now I'm confused how to do it as they're not located in the same server.

anyone can help with this?

Upvotes: 1

Views: 22

Answers (1)

Pawel Czapski
Pawel Czapski

Reputation: 1864

As pointed by @EzLo, you can create linked server and alter your query to specify full route to your view.

INSERT INTO table1
SELECT * 
FROM LINKED_SERVER.YOUR_DATABASE.OBJECT_SCHEMA.view1

Upvotes: 2

Related Questions