question

GaniTPT avatar image
0 Votes"
GaniTPT asked GaniTPT commented

How to create view from another server

I have 2 server which is server1 and server2

i just want copy of the view from server 2 and same to be in server1.

the main thing is, i don't want all the tables and views. i just want only one view from server2 and same to be reflected in server1.

Is it possible to create view without using linked server..?

Example:

Server2 :

             TESTDB ==> 
                                dbo.view1
                                dbo.view2

I want to fetch view from (server2 ==> TESTDB ==>dbo.view2)

Note : if i use linked server, the other person may be able to see all the db,tables and views. we just want to restrict.

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered GaniTPT commented

Is it possible to create view without using linked server..?

Instead of a Linked Server (which should be preferred for your requirement) you can use OPENROWSET (Transact-SQL) ; which is a kind of ad-hoc Linked Server.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

even if we use linked server, can we connect only particular view...????

0 Votes 0 ·

It's called "Linked Server" because it points to a server, not to a particular database nor objects.

Which objects can be accessed depends on the given permissions for the logon; so grant only SELECT permissions for the view.

0 Votes 0 ·

Thanks....

0 Votes 0 ·