> For the complete documentation index, see [llms.txt](https://docs.deltastream.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltastream.io/reference/sql-syntax/query/insert-into-entity.md).

# INSERT INTO ENTITY

## Syntax <a href="#synopsis" id="synopsis"></a>

{% code overflow="wrap" %}

```sql
INSERT INTO ENTITY entity_name [IN STORE store_name] [KEY(json_string)] VALUE (json_string);
```

{% endcode %}

## Description <a href="#description" id="description"></a>

For an existing entity, `INSERT INTO ENTITY` inserts a JSON string provided in the VALUE clause into the the entity's value field, and optionally writes the JSON string in the **KEY** clause into its key field. The command processes and inserts exactly one JSON record per execution.

{% hint style="info" %}
`INSERT INTO ENTITY` supports only Kafka topics and Kinesis data stream as the sink entity.
{% endhint %}

### Arguments <a href="#parameters" id="parameters"></a>

#### entity\_name

This specifies the name of the entity to add the json string to. For case-sensitive names, the name must be wrapped in double quotes; otherwise, the lowercase name will be used.

#### store\_name

The Kafka or Kinesis store (topic/stream) to which the record will be published.

#### **json\_string**

The JSON string to be inserted into the entity.

## Examples

#### Insert into an entity in a given Store

{% code overflow="wrap" %}

```sql
INSERT INTO ENTITY users IN STORE kafkaStroe  KEY('{"userid": "User_7"}') VALUE('{"registertime": 1753311127306,"userid": "User_7","regionid": "Region_1","gender": "OTHER","interests": ["News","Travel"],"contactinfo": {"phone": "6502215368","city": "San Carlos","state": "CA","zipcode": "94070"}') ;    
```

{% endcode %}

#### Insert only into the "value" of a topic in the default Kafka store

{% code overflow="wrap" %}

```sql
INSERT INTO ENTITY users VALUE('{"registertime": 1753311127306,"userid": "User_7","regionid": "Region_1","gender": "OTHER","interests": ["News","Travel"],"contactinfo": {"phone": "6502215368","city": "San Carlos","state": "CA","zipcode": "94070"}') ;    
```

{% endcode %}
