---
title: "Sys.File.History"
slug: "sysfilehistory"
updated: 2024-09-16T10:47:45Z
published: 2024-09-16T10:47:45Z
canonical: "support.lusid.com/sysfilehistory"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sys.File.History

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | Finbourne | Provided with LUSID |

The `Sys.File.History` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that lists the history of all files ever held in the Luminesce file system.

> **Note:** The LUSID user running the query must have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users) to both use the provider *and* read file history data in the Luminesce file system. This should automatically be the case if you are the domain owner.

**See also:** [Sys.File](/v1/docs/sysfile)

## Basic usage

```sql
select * from Sys.File.History where <filter-expression>;
```

## Query parameters

`Sys.File.History` has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Sys.File.History' and FieldType = 'Parameter';
```

## Data fields

By default, `Sys.File.History` returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Sys.File.History' and FieldType = 'Column';
```

> **Note:** Fields marked 'main' are returned by queries that include a caret character, for example `select ^ from Sys.File.History`.

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples).

### Example 1: Retrieve first 10 file history records

```sql
select * from Sys.File.History limit 10
```

### Example 2: Retrieve content history for a particular provider

You can use `Sys.File.History` to retrieve the history of user configuration changes ([’inline’ properties](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties)) to providers.

```sql
select Content from Sys.File.History where Name = 'instrumentproviderfactory'
```

### Example 3: Retrieve content history for a custom view

```sql
select Content from Sys.File.History where Name = 'Views.MyView'
```
