SSRS: bulk rename reports

Michael Edwards 1 Reputation point
2021-03-09T15:54:55.937+00:00

Hi.

We have many legacy reports that have not been executed in a long time. I can find these from a persisted version of the ExecutionLogStorage table (or the fact that they are not in there at all but are in the catalog table).

I have tested then renaming these with a TOBEDELETED_YYYYMMDD suffix, as simply as this:

UPDATE
ReportServer.dbo.catalog
SET name = name + '_TOBEDELETED_20210309' , path = Path +'_TOBEDELETED_20210309'
--- where ......

This appears to work completely fine. The reports appear in the SSRS web app with the new names and still run fine. The idea is that in 6 months time I will use a PowerShell script to permanently delete these reports.

Can anyone see any potential problems with this approach? Thanks!

PS. Have more recently spotted (using SQL Profiler when renaming a report from the front end) this proc: ReportServer..MoveObject:

EXECUTE @RC = [dbo].[MoveObject]
@OldPath
,@OldPrefix
,@NewName
,@NewPath
,@NewParentID
,@RenameOnly
,@MaxPathLength

Any thoughts on using that instead?

Lastly PowerSell does not seem to support the MoveItem method, but DotNet does (https://learn.microsoft.com/en-us/dotnet/api/reportservice2010.reportingservice2010.moveitem?redirectedfrom=MSDN&view=sqlserver-2016#ReportService2010_ReportingService2010_MoveItem_System_String_System_String_)

Is anyone aware if I am wrong about this and rename is possible through PowerShell? Thanks

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,836 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lukas Yu -MSFT 5,816 Reputation points
    2021-03-10T09:41:26.307+00:00

    Hi,

    Can anyone see any potential problems with this approach? Thanks!

    From the server side , I don't think there are much problem with this operation. You could get some problems with linked-report or subreport, since the name changed. Other function should not affected to much as they are using ID to be joined. But still, generally it is not suggested to directly operate on the database level data, I could also fully thought through what is the potential risk. But an operation like this, you could always recall it.