> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/sql-commands/connections/alter-connection.md).

# ALTER CONNECTION

## Syntax

```sql
ALTER {      
        ELASTICSEARCH |
        GLUE_CATALOG | 
        ICEBERG_REST_CATALOG |
        KAFKA | 
        KINESIS |      
        MSSQL |
        MONGODB |
        MYSQL |
        POSTGRES |
        REDSHIFT |
        S3 |  
        SNOWFLAKE 
        } CONNECTION <connection_identifier>
    SET <connection_option> = <value>
    [ SET <connection_option2> = <value2> ... ]; 
```

{% hint style="warning" %}
Note that not all connection options are mutable.
{% endhint %}

### Connection options

#### Cloud storage

* [Amazon S3](/content/reference-1/sql-commands/connections/create-connection/amazon-s3.md)

#### Metastores

* [AWS Glue Data Catalog](/content/reference-1/sql-commands/connections/create-connection/aws-glue-data-catalog.md)
* [Polaris Catalog ](/content/reference-1/sql-commands/connections/create-connection/polaris-catalog.md)

#### Streaming systems

* [Amazon Kinesis](/content/reference-1/sql-commands/connections/create-connection/amazon-kinesis.md)
* [Apache Kafka](/content/reference-1/sql-commands/connections/create-connection/apache-kafka.md)

#### Databases

* [Amazon Redshift](/content/reference-1/sql-commands/connections/create-connection/amazon-redshift.md)
* [Elasticsearch](/content/reference-1/sql-commands/connections/create-connection/elasticsearch.md)
* [Microsoft SQL Server](/content/reference-1/sql-commands/connections/create-connection/microsoft-sql-server.md)
* [MySQL](/content/reference-1/sql-commands/connections/create-connection/mysql.md)
* [PostgreSQL](/content/reference-1/sql-commands/connections/create-connection/postgresql.md)
* [Snowflake](/content/reference-1/sql-commands/connections/create-connection/snowflake.md)

## Rename connection

You can rename a connection with immediate effect using the following syntax:

```sql
ALTER CONNECTION <old_conn_name> RENAME TO <new_conn_name>;
```

### Example

In the following example, the **mssql\_prod** connection is renamed to **mssql\_prod\_emea** to clarify which server this connects to:

```sql
ALTER CONNECTION mssql_prod RENAME TO mssql_prod_emea; 
```

To view the details for a connection before or after you rename it, you can query the [system.information\_schema.connections](/content/reference-1/monitoring/system-catalog/information-schema/connections.md) table.&#x20;

The following query performs a wildcard search to find all connections with a name prefix of **mssql\_**.

```sql
SELECT * 
FROM system.information_schema.connections
WHERE name LIKE 'mssql_%';
```

This enables you to check the connection details to ensure you rename the correct object, or to find all connections you want to rename.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/sql-commands/connections/alter-connection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
