---
sidebar_position: 3
title: MD_CURRENT_CLIENT_CONNECTION_ID and MD_CURRENT_CLIENT_DUCKDB_ID
description: Retrieve connection identifiers and DuckDB instance IDs for debugging and monitoring.
---

:::info
This is a preview feature. Preview features may be operationally incomplete and may offer limited backward compatibility.
:::

# MD_CURRENT_CLIENT_CONNECTION_ID and MD_CURRENT_CLIENT_DUCKDB_ID

`md_current_client_connection_id` and `md_current_client_duckdb_id` are two scalar functions that can be used to identify the current `client_connection_id` and `client_duckdb_id`.

## Syntax

```sql
SELECT md_current_client_connection_id();
SELECT md_current_client_duckdb_id();
```

## Example usage
To [interrupt](documentation/sql-reference/motherduck-sql-reference/connection-management/interrupt-connections.md) all server-side connections that are initiated by the current client DuckDB instance, we can use:

```sql
SELECT md_interrupt_server_connection(client_connection_id)
FROM md_active_server_connections()
WHERE client_duckdb_id = md_current_client_duckdb_id()
  AND client_connection_id != md_current_client_connection_id();
```


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/sql-reference/motherduck-sql-reference/connection-management/connection-duckdb-id/",
  "page_title": "MD_CURRENT_CLIENT_CONNECTION_ID and MD_CURRENT_CLIENT_DUCKDB_ID",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
