Skip to content

Instantly share code, notes, and snippets.

ximon / SSRS datasource change.sql
Last active June 28, 2023 13:48
Change SSRS report embedded datasource to shared datasource
View SSRS datasource change.sql
use [ReportServer]
DECLARE @Path nvarchar(250) = '/' --The path where you want to scan for reports
DECLARE @Commit bit = 0
DECLARE @SharedDSName nvarchar(250) = '/SharedDS' --The name of the shared dataset to use
IF NOT EXISTS(SELECT 1 FROM [CataLog] Where [Path] = @SharedDSName)
print 'Could not find shared data source "' + @SharedDSName + '" !'