Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helplinkedsrvlogin

  No additional text.


Syntax
create procedure sys.sp_helplinkedsrvlogin
	@rmtsrvname		sysname = NULL,
	@locallogin		sysname = NULL
as
	declare	@srvid	int,
			@lgnid	int

    -- CHECK REMOTE SERVER NAME.
    if @rmtsrvname is not null
    begin
    	select @srvid = server_id from sys.servers where name = @rmtsrvname
    	if @srvid is null
    	begin
		raiserror(15015,-1,-1,@rmtsrvname)
		return (1)
    	end
    end

    -- IF SPECIFIED CHECK LOCAL USER NAME
    if (@locallogin IS NOT NULL)
    begin
    	select @lgnid = principal_id from sys.server_principals where name = @locallogin
    end

    select	u.name as [Linked Server], t.name as [Local Login],
		s.uses_self_credential as [Is Self Mapping], s.remote_name as [Remote Login]
    from sys.linked_logins s left join sys.server_principals t
		on s.local_principal_id=t.principal_id, sys.servers u
    where ((@srvid is null or @srvid=u.server_id) and u.server_id= s.server_id)
		and (@locallogin is null or @lgnid=s.local_principal_id)
    order by u.name

    -- RETURN SUCCESS
    return(0) -- sp_helplinkedsrvlogin

 
Last revision 2008RTM
See also

  sp_MSchangerepllinkedsrvrpassword (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash