---
title: MD_VERSION
description: Inspect the loaded MotherDuck extension version and build hash.
---

# MD_VERSION

MotherDuck exposes `MD_VERSION` both as a scalar function and as a pragma.

Use the scalar function when you only need the version string. Use the pragma when you also want the extension hash.

## Syntax

```sql
SELECT md_version();

PRAGMA md_version;
```

## Output

`SELECT md_version();` returns a single `VARCHAR` value.

`PRAGMA md_version;` returns:

| Column Name | Data Type | Value |
|-------------|-----------|-------|
| `md_extension_version` | VARCHAR | Loaded MotherDuck extension version |
| `md_extension_hash` | VARCHAR | MotherDuck extension build hash |

## Example usage

```sql
SELECT md_version();
```

```sql
PRAGMA md_version;
```
