preface: SSRS GUI is so clunky to me, i tried to avoid it.So there's a suite of reports on one of my servers that i can't find the original project for.i just wanted to tweak one tiny little snippet of code, though, so i got fancy.i extracted the image of one specific report back to an xml file, myreport.rdl. via some CLR functions i use all the time.[code]DECLARE @image varbinary(max)select @image = Content from reportserver.dbo.Catalog where name ='MyReport'exec dba_utilities.dbo.CLR_SaveFileImage 'D:\temp','MyReportV2.rdl',@image[/code]I wanted to change the <CommandText> that is used for a specific datasource, so i did in a plain old text editor, and then updated the Content right back.[code]DECLARE @image varbinary(max)select @image = dba_utilities.dbo.CLR_GetFileImage('D:\temp','MyReport.rdl')UPDATE reportserver.dbo.CatalogSET Content = @imagewhere name ='MyReport'[/code]the CLR for image read/write is bulletproof, there's definitely no errors there; i can compare old and new and definitely see the changes in the report definition .so i kick off the subscription for that report, and immediately run sp_whoisactive. i get the name of the job and the command to kick off the job via this query:[code]SELECT distinct 'exec msdb.dbo.sp_start_job @job_id = ''' + convert(varchar(40),b.job_id) COLLATE SQL_Latin1_General_CP1_CI_AS + '''; --' + + b.name COLLATE SQL_Latin1_General_CP1_CI_AS + ' : ' + e.name COLLATE SQL_Latin1_General_CP1_CI_AS As Cmd, b.job_id As JobID, b.name AS JobName , e.name , e.path , d.description , a.SubscriptionID , laststatus , eventtype , LastRunTime , date_created , date_modified FROM ReportServer.dbo.ReportSchedule a JOIN msdb.dbo.sysjobs b ON convert(varchar(40),a.ScheduleID) = b.name JOIN ReportServer.dbo.ReportSchedule c ON b.name = convert(varchar(40),c.ScheduleID) JOIN ReportServer.dbo.Subscriptions d ON c.SubscriptionID = d.SubscriptionID JOIN ReportServer.dbo.Catalog e ON d.report_oid = e.itemid where 1 = 1 and e.name = 'MyReport' order by e.name[/code]sp_whoisactive is showing the OLD SQL statement that is WAS in the <CommandText> of the Datasource, and not the new one.ok so i thought, maybe reporting services caches the content, so i stopped and started the Reporting Services Service via RS Configuration Manager, and ran the SSRS report again.sp_whoisactive shows that it's definitely the old command still, regardless of the direct update i made to the [Content] column.so my question is for a subscription, is the report definition copied to a second location, so i need to change it there too?
↧