Skip to content

Instantly share code, notes, and snippets.

@ximon
ximon / SSRS datasource change.sql
Last active April 3, 2024 06:01
Change SSRS report embedded datasource to shared datasource
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)
BEGIN
print 'Could not find shared data source "' + @SharedDSName + '" !'