---
schema_version: "1"
id: 46b58f2e78ce0ebccd8fb64de5969d5331a056b3f18bc29c316b31c61e3cc44e
title: "Query: Bounce History"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_as_query_bounce_history.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_as_query_bounce_history.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: be7f3030b86ab655efaa3df9743ba1278dfddd3ca2deb1b41bf436612d73441a
description: Find a history of individual bounce responses, and identify how to resolve them.
products:
  - Marketing
  - Marketing Cloud Engagement
release: "264"
---
# Query: Bounce History

Find a history of individual bounce responses, and identify how to resolve them.

## Before You Begin

To use this example, you need a working knowledge of SQL. You can copy and paste the code samples, but you must configure them for your setup.

## Create a Target Data Extension

In Contact Builder or Email Studio, create a standard data extension with these properties and fields. This data extension is the destination for your query’s data output.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Target Data Extension</td><td class="slds-cell-wrap" style="vertical-align:top;">BounceHistory</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">External Key</td><td class="slds-cell-wrap" style="vertical-align:top;">BounceHistory</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Retention Setting</td><td class="slds-cell-wrap" style="vertical-align:top;">On</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Delete</td><td class="slds-cell-wrap" style="vertical-align:top;">Individual Records</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Retention Period</td><td class="slds-cell-wrap" style="vertical-align:top;">180 Days</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_journeys_and_automations-264-0-0-production-enus/e08cdd71-c1c1-4ae5-a5e9-8a6dad583ad4/images/icon_note.png)

Note If you create the data extension in Email Studio, the Nullable column replaces the Required column. If a field isn’t required, select **Nullable**. If a field is required, don’t select Nullable.

     
| Primary Key | Name | Data Type | Required | Length | Default Value |
| --- | --- | --- | --- | --- | --- |
| X | SubscriberID | Number | X |   |   |
| X | JobID | Number | X |   |   |
| X | ListID | Number | X |   |   |
| X | BatchID | Number | X |   |   |
|   | EventDate | Date |   |   |   |
|   | EmailAddress | Email Address |   |   |   |
|   | SubscriberKey | Text |   | 254 |   |
|   | EmailName | Text |   | 100 |   |
|   | Domain | Text |   | 100 |   |
|   | BounceCategory | Text |   | 50 |   |
|   | SMTPBounceReason | Text |   | 4000 |   |
|   | InsertedDate | Date |   |   | Select **use the current system date** |

## Create a Query Activity

In Automation Studio, create an SQL query with these properties.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Query Name</td><td class="slds-cell-wrap" style="vertical-align:top;">BounceHistory</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">External Key</td><td class="slds-cell-wrap" style="vertical-align:top;">BounceHistory</td></tr></tbody></table>

## Sample Query

Copy and paste this query.

```xquery
SELECT b.SubscriberID,
       b.JobID,
       b.ListID,
       b.BatchID, 
       b.EventDate,
       l.EmailAddress,
       b.SubscriberKey,
       j.EmailName,
       b.Domain, 
       b.BounceCategory,
       b.SMTPBounceReason
FROM   _listsubscribers AS l 
      INNER JOIN _bounce AS b 
              ON l.SubscriberID = b.SubscriberID 
      INNER JOIN _job AS j
              ON b.JobId = j.JobID
WHERE  b.EventDate > DATEADD(dd, -3, GETDATE()) 
```

## Finalize the Query Activity

Link the query to the target data extension.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Target Data Extension</td><td class="slds-cell-wrap" style="vertical-align:top;">BounceHistory</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Data Action</td><td class="slds-cell-wrap" style="vertical-align:top;">Update</td></tr></tbody></table>

Save your query activity, and then create and activate an automation that uses the activity. To continuously update your bounce history, run the automation every 24 hours.

## Query Variation: Capture Bounces for a Specific Email

To capture bounces for a specific email, add this line to the end of the query and replace MY\_EMAIL\_NAME with the name of the email.

```
AND j.emailname = MY_EMAIL_NAME
```

## Query Variation: Capture Bounces for a Specific Job

To capture bounces for a specific job, add this line to the end of the query and replace MY\_JOB\_ID with the job ID.

```
AND j.jobid = MY_JOB_ID
```

#### See Also

- [Create a Data Extension in Contact Builder](https://help.salesforce.com/s/articleView?id=mktg.mc_cab_create_a_new_data_extension.htm&type=5&language=en_US)
- [Create a Data Extension in Email Studio (Enhanced)](https://help.salesforce.com/s/articleView?id=mktg.mc_es_create_data_extension.htm&type=5&language=en_US)
- [Build a SQL Query Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_use_the_sql_query_activity.htm&release=264.0.0&type=5 "In Automation Studio, build a SQL query activity that retrieves the data that you’re interested in, and then add it to an automation.")
- [Optimizing a SQL Query Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_optimize_the_query_activity.htm&release=264.0.0&type=5 "SQL query activities time out after 30 minutes. You can prevent timeouts and failures by optimizing your SQL query activities. If your query consistently runs longer than 10 minutes, we recommend using a different tool, such as Salesforce Customer Data Platform, to transform your data.")
- [SQL Reference](https://help.salesforce.com/s/articleView?id=mktg.mc_as_sql_reference.htm&release=264.0.0&type=5 "Get SQL query information for Automation Studio’s SQL Query activity at a glance.")