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

# Identifier Linking via SQL

> Linking identifiers using SQL

## Overview

Identifiers can be linked directly in SQL. This is useful when when you have a real-time identifier match in a SQL process or when back-filling data.

## Roles

A user must be assigned of the following [application roles](/snowflake-app-details#application-roles) to execute any of the examples described on this page:

* `admin`
* `editor`
* `scientist`

## Link Identifiers

To link two identifiers, simply make a stored procudure call. Note that the referenced Subject Types must exist already.

```SQL theme={null}
SELECT experimentation.link_identifiers('<Subject Type A>', '<Subject ID A>', '<Subject Type B>', '<Subject ID B>');
```

## Examples

### Link an anonymous ID to a customer ID

```SQL theme={null}
SELECT experimentation.link_identifiers('CUSTOMER_ID', 'u_123', 'ANON_ID', 'a_123');
```

###
