# How Do I Create Salesforce Table Views?

Salesforce has a handful of tables that are almost certainly implemented as database Views internally within Salesforce. Some of the views are quite odd:

* The ActivityHistory table combines data from the Task and Event table BUT cannot be queried directly using Salesforce APIs.

Though most Salesforce table views can be read directly, representing them as a view in the Salesforce backup database rather than including them as tables in the Salesforce data backup speeds up CopyStorm backup jobs and reduces the [size of database files](/frequently-asked-questions/installation/how-large-does-my-database-need-to-be.md).

The following table contains links to SQL that can be used to create database views in your CopyStorm Salesforce backup that will mimic the corresponding Salesforce table views:

| Salesforce Table Name     | View Name                 | Link to CREATE VIEW SQL                                                                                                    |
| ------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| ActivityHistory           | ActivityHistoryView       | [ActivityHistory.sql](http://download.capstorm.com/support/CopyStormDatabaseViews/ActivityHistoryView.sql)                 |
| AccountUserTerritory2View | AccountUserTerritory2View | [AccountUserTerritory2View.sql](http://download.capstorm.com/support/CopyStormDatabaseViews/AccountUserTerritory2View.sql) |

After creating the corresponding database view you will no longer need to include the table in your Salesforce backup, speeding up backup time and reducing storage costs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/frequently-asked-questions/problems-solutions/how-do-i-create-salesforce-views.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
