Solved

refining sp_linkedservers

Posted on 2004-09-06
2
1,347 Views
Last Modified: 2008-01-09
Hi.

sp_linkedservers returns a resultset. How can I use this data in a sql query if I cannot refer to it ?
I wanted to check if my server is in this resultset list and then take some action.

Gregor


0
Comment
Question by:gregajesih
2 Comments
 

Author Comment

by:gregajesih
Comment Utility
Found by serching.. thanks for reading my question..sorry for bothering..
0
 
LVL 10

Accepted Solution

by:
AustinSeven earned 250 total points
Comment Utility
insert the output into a temp table.   However, you'll need to create the temp table with the required columns so you'll need to examin the QA output:-

create table #linkedsrv (
SRV_NAME varchar(100),
SRV_PROVIDERNAME varchar(100),
SRV_PRODUCT varchar(100),
SRV_DATASOURCE varchar(100),
SRV_PROVIDERSTRING varchar(100),
SRV_LOCATION varchar(100),
SRV_CAT varchar(100) )

insert into #linkedsrv
exec sp_linkedservers

select * from #linkedsrv

drop table #linkedsrv


AustinSeven
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now