December 5, 2016 at 10:39 am
I would like to use a script to update the data source used for connections to support multiple folder structures with duplicate reports.
At first, it appeared that Data Source is the cross reference for reports but that doesn’t seem to be it.
It also doesn’t seem to be the value of <rd:DataSourceID> in the XML.
How do I update a specific RDLs data source connection via a script?
SELECT TOP (2)
R.ItemID AS ReportId
, R.[Path] AS ReportPath
, R.Name AS ReportName
, D.Name AS DSName
, D.[Path] AS DSPath
, CAST(CAST(R.[Content] AS [varbinary](MAX)) AS XML) reportXML
FROM
[Catalog] AS R INNER JOIN DataSource AS X ON R.ItemID = X.ItemID
INNER JOIN [Catalog] AS D ON X.Link = D.ItemID
WHERE
R.[Type] = 2
AND D.[Type] = 5
ORDER BY
ReportPath
December 6, 2016 at 5:53 am
You shouldn't do it using the tables in the ReportServer database. You need to go through the web service. One option listed here:
There are a several powershell scripts out there to do it as well if you want to search on those.
Sue
December 7, 2016 at 8:59 am
Thank you but I would prefer to do it directly for several reasons.
Does anyone know how to accomplish this?
December 7, 2016 at 9:21 am
What sort of data source do your reports use - embedded or shared? If you use a shared data source then you only need to change it in one place, which won't be the report definition. I agree with Sue, though - leave the tables well alone and use one of the supported, less dangerous ways of doing it.
John
December 7, 2016 at 12:09 pm
Thank you.
They are shared.
What do I need to update?
December 8, 2016 at 2:08 am
I don't know. There's a ConnectionString column in the DataSource table, but it's not in plain text. Like I said, I don't recommend hacking the tables, and I don't suppose it's even supported.
John
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply