# DETACH PIPELINE

The `DETACH PIPELINE` command is similar to the `STOP PIPELINE` command with the difference being `ALTER TABLE` can be performed on a detached pipeline for the table that is currently being referenced by the pipeline.

## Syntax

```sql
DETACH PIPELINE [IF EXISTS] <pipeline_name>;
```

## Remarks

* Use the `START PIPELINE` clause to reattach a detached pipeline.
* Use the `SHOW PIPELINES` clause to see the pipeline's state.
* For more information on altering a table, see [ALTER TABLE](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-definition-language-ddl/alter-table.md).
* Refer to the [Permissions Matrix](https://docs.singlestore.com/db/v9.1/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permissions.

## Examples

```sql
DETACH PIPELINE IF EXISTS books;

SHOW PIPELINES;


```

```output

+-------------------------+----------+
| Pipelines_in_testdb     | State    |
+-------------------------+----------+
| books                   | Detached |
+-------------------------+----------+

```

```sql
START PIPELINES;

SHOW PIPELINES;


```

```output

+-------------------------+---------+
| Pipelines_in_testdb     | State   |
+-------------------------+---------+
| books                   | Running |
+-------------------------+---------+
```

***

Modified at: June 11, 2026

Source: [/db/v9.1/reference/sql-reference/pipelines-commands/detach-pipeline/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/pipelines-commands/detach-pipeline/)

(An index of the documentation is available at /llms.txt)
