List all Shared Data Sources | SansSQL

Monday, June 20, 2016

List all Shared Data Sources

Here is a handy script to list all the Shared Data Sources from the ReportServer Database.
WITH BasicData AS 
(
SELECT CONVERT(VARBINARY(MAX),Content) AS Content,
[Catalog].Name,[Path],ConnectionString FROM [Catalog] INNER JOIN DataSource
ON [Catalog].ItemID=DataSource.ItemID
WHERE [Type]=5 -- Type=5, Filters Shared Data Sources
)
,DataWithXML AS
(
SELECT 
Name, [Path], CONVERT(XML,Content) AS ContentXML 
FROM BasicData
)
SELECT Name, [Path], ConnectionString.value('(text())[1]','nvarchar(max)') AS ConnectionString
FROM DataWithXML 
CROSS APPLY DataWithXML.ContentXML.nodes('//*:ConnectString') AS ConnectionStrings(ConnectionString)

3 comments:

Unknown said...

Thanks you for sharing the unique content. you have done a great job. thank you for sharing such a unique content.
Informatica Training in Chennai Adyar

Redford Brown said...

Hi author, great share. I've just started learning to code and this particular post might come handy in the future. For that i am following your site regularly. Best of regards from EvoEssay.com hope you could visit us too when you're free.

Unknown said...

Good one, very informative.. thanks for sharing your views and ideas.. it is very useful to me.. thanks once again


Software Testing Training in chennai | Android Training in chennai

Post a Comment

Ads