Groups | Blog | Home
all groups > sql server mseq > december 2003 >

sql server mseq : Linked Servers


Fulvio Hayes
12/15/2003 12:38:19 PM
Can one use Linked Servers to link back to the same
server? If so, how can one perform this operation?

fulvio

Vishal Parkar
12/16/2003 9:59:53 PM
Fulvio,

[quoted text, click to view]

Yes, but why do you want to do that. you can straightaway refer to any object located in a
particular database located on the same server using 3 part naming convention provided the
login that you are using has required permission on it.

Ex
use pubs
go
select * from northwind.dbo.customers -- using 3 part naming convention.


--
- Vishal

Fulvio Hayes
12/18/2003 7:52:17 AM

Vishal:
I am trying to create a view on another database on the
same server which accesses information from the original
database. I don't wish to create a separate logon with all
the required permissions. This server is SQL Server 2000
SP3+.

How can I create the Link Back to the same server?

[quoted text, click to view]
Vishal Parkar
12/19/2003 11:03:14 PM
Fulvio,

[quoted text, click to view]

So no need to have linked server for this. see following example.

use pubs
go
create view access_table_from_northwind
--creating view in pubs database referring table of northwind database.
as
select customerid,contactname from northwind.dbo.customers
go
select * from access_table_from_northwind --accessing view from pubs database

[quoted text, click to view]

If you are under impression that linked server do not require login then you are wrong it
does require login to connect. I m not saying you to create a seperate login for this,
just grant database access to this login to the respective database and grant SELECT
permission to required tables.

--
- Vishal

AddThis Social Bookmark Button