Snippet Name: SSRS_Subscription_Status_Check
Tags:
Created Date: 2025-06-16 13:12:44
Last Modified Date: 2025-05-31 10:31:41
Dependencies:
DBA Notes:
Sample Output:
Title: SSRS Subscription Status Check
Author: user
in SQL Server Reporting Services, I have a subscription that says it's state is "Pending", but appears to be completed, or hung. how can i determine a better status?
Author: ChatGPT
To determine a better status for a subscription in SQL Server Reporting Services (SSRS) that shows as "Pending," you can follow these steps to get more detailed information:
### 1. Check the Execution Log
The execution log in SSRS contains detailed information about report executions, including subscriptions. You can query the execution log to find more details about the subscription's status.
```sql
USE ReportServer;
GO
SELECT
InstanceName,
ItemPath,
UserName,
ReportAction,
TimeStart,
TimeEnd,
TimeDataRetrieval,
TimeProcessing,
TimeRendering,
Source,
Status,
ByteCount,
RowCount
FROM ExecutionLog3
WHERE ItemPath LIKE '/Path/To/Your/Report'
AND TimeStart >= '2024-01-01'; -- Adjust the date as necessary
```
### 2. Check the Subscriptions Table
You can also query the `Subscriptions` table to get the status and details of the subscription.
```sql
USE ReportServer;
GO
SELECT
SubscriptionID,
Report_OID,
OwnerID,
SubscriptionType,
LastStatus,
EventType,
LastRunTime,
DeliveryExtension,
Version
FROM Subscriptions
WHERE SubscriptionID = 'your-subscription-id'; -- Replace with your actual Subscription ID
```
### 3. Check the Report Server Execution Log (ReportServer database)
This log provides more granular information about the report executions and can help identify why a subscription might be stuck in a "Pending" state.
```sql
USE ReportServer;
GO
SELECT
SubscriptionID,
ReportID,
Status,
LastRunTime,
ExtensionSettings,
ModifiedBy,
ModifiedDate
FROM ExecutionLog2
WHERE SubscriptionID = 'your-subscription-id'; -- Replace with your actual Subscription ID
```
### 4. Review the Report Server Logs
The Report Server log files can also provide insights into any errors or issues that might have caused the subscription to hang. These logs are typically found in the `LogFiles` directory of your SSRS installation. You can review the most recent log files for any error messages related to the subscription.
### 5. Check for Job Status in SQL Server Agent
SSRS subscriptions are managed by SQL Server Agent jobs. You can check the status of these jobs to see if there are any issues.
1. Open SQL Server Management Studio (SSMS).
2. Expand the SQL Server Agent node.
3. Look for a job with a name that matches or is related to your subscription.
4. Check the job history for any errors or issues.
### 6. Restart the SQL Server Reporting Services
If the subscription appears to be hung, sometimes restarting the SSRS service can resolve the issue. To do this:
1. Open the Services management console (`services.msc`).
2. Find the `SQL Server Reporting Services` service.
3. Right-click and choose `Restart`.
By using these methods, you should be able to get a clearer picture of the status of your subscription and identify any underlying issues.