# UPDATE SECRET

## Syntax

```sql
UPDATE SECRET secret_name WITH (secret_parameter = value [, ...]);
```

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

Updates a new secret within the organization.

### Arguments

#### secret\_name

Name of the secret to update. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lower case name.

#### WITH (secret\_parameter = value \[, …​ ])

This clause specifies secret parameters; see [secret parameters](https://docs.deltastream.io/reference/sql-syntax/create-secret#_secret__parameters) for more information.

### Secret Parameters <a href="#secret_parameters" id="secret_parameters"></a>

| Parameter Name                              | Description                                                                    |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| `description`                               | <p>Optional. A description for the secret<br><strong>Type:</strong> String</p> |
| ### **GENERIC\_SECRET Specific Parameters** |                                                                                |

Parameters to be used if `type` is `GENERIC_SECRET`:

| Parameter Name  | Description                                                                                                                                                                                                                                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `secret_string` | <p>The string to store in the secret. The string may function as either an API token or a sensitive value string, to be utilized within the handler code of a user-defined function (UDF).<br><br><strong>Required:</strong> Yes<br><strong>Default value:</strong> None<br><strong>Type:</strong> String</p> |

## Examples

#### Update a GENERIC\_SECRET

The following updates a secret named `my_secret`:

```sh
demodb.public/demostore# UPDATE SECRET 
    my_secret
WITH ( 
    'secret_string' = 'SGVsbG8gdXBkYXRlZCBEZWx0YXNTdHJlYW0hCg==', 
    'description' = 'This is an updated generic_string secret'
);
+------------+------------+------------+------------------------------------------+
|  Type      |  Name      |  Command   |  Summary                                 |
+============+============+============+==========================================+
| secret     | my_secret  | UPDATE     | secret "my_secret" was successfully      |
|            |            |            | updated                                  |
+------------+------------+------------+------------------------------------------+
```
