SQL Query Help

Hello Guys,

I am using the following SQL script to get the execution stats for the reports created by querying the SSRS ReportServer:

select username as [User Name], Itempath as [Report Name], parameters as [Variables], timestart as [Execution Start Time], timeend as [Execution End Time], TimeProcessing as [Total Time(ms)], status as [Outcome] from ExecutionLog3
order by TimeStart desc

Open in new window

One of the output columns is this:

/{d42a1aa2-3237-46f9-8ee3-fd3055f95f65}/sites/pr05_bi/KPB/SolubSulf/SolubSulf PR05 Reports/Process_Monitoring_Quantities_and_Yields_Yield_Ph2A.rdl

My requirement is just to get the rdl names:


Can I modify the above given SQL code in anyway to get this type requirement attained. Currently I'm using excel for this purpose. Please look into this and suggest an edit in the query.
Eldo issacAsked:
Who is Participating?
Lokesh B RDeveloperCommented:

try this query

SELECT RIGHT(ColumnName , CHARINDEX( '/', REVERSE(ColumnName) + '/' ) - 1 ) AS FileName  FROM  YourTableName

Open in new window

Nathan RileyFounderCommented:
So you want to strip anything before process_monitoring?  Is this always the case?
Eldo issacAuthor Commented:
Hello Guys,

@Nathan: I want to strip everything before the .rdl name.

@Jim: Apologies for my mistake. I'll surely keep this in mind from next time on.

@Lokesh B R: Thanks for your reply. It's working perfect.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.