> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DROP SCHEDULES

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The `DROP SCHEDULES` <InternalLink path="sql-statements">statement</InternalLink> can be used to remove <InternalLink path="create-schedule-for-backup">backup schedules</InternalLink> or <InternalLink path="create-schedule-for-changefeed">changefeed schedules</InternalLink>.

When `DROP SCHEDULES` removes a <InternalLink path="create-schedule-for-backup#create-a-schedule-for-full-backups-only">full backup schedule</InternalLink>, it removes the associated <InternalLink path="create-schedule-for-backup#incremental-backup-schedules">incremental backup schedule</InternalLink>, if it exists.

<Danger>
  `DROP SCHEDULE` does **not** cancel any in-progress jobs started by the schedule. Before you drop a schedule, <InternalLink path="cancel-job">cancel any in-progress jobs</InternalLink> first, as you will not be able to look up the job ID once the schedule is dropped.
</Danger>

## Required privileges

The following users can drop a schedule:

* Members of the <InternalLink path="security-reference/authorization#default-roles">`admin` role</InternalLink>. By default, the `root` user belongs to the `admin` role.
* Owners of a backup schedule, i.e., the user that <InternalLink path="create-schedule-for-backup">created the backup schedule</InternalLink>.
* Owners of a changefeed schedule, i.e., the user that <InternalLink path="create-schedule-for-changefeed">created the changefeed schedule</InternalLink>.

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/w6H3zc9JqC1vaAQB/images/sql-diagrams/v24.3/drop_schedule.svg?fit=max&auto=format&n=w6H3zc9JqC1vaAQB&q=85&s=8b2cc7ad8b3286ae3c05318b59ca215e" alt="drop_schedule syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="391" height="81" data-path="images/sql-diagrams/v24.3/drop_schedule.svg" />

## Parameters

| Parameter      | Description                                                                                                                             |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `selectclause` | A <InternalLink path="selection-queries">selection query</InternalLink> that returns `id`(s) to drop.                                   |
| `scheduleID`   | The `id` of the schedule you want to drop, which can be found with <InternalLink path="show-schedules">`SHOW SCHEDULES`</InternalLink>. |

## Examples

### Drop a schedule

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP SCHEDULE 589963390487363585;
```

```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
DROP SCHEDULES 1
```

### Drop multiple schedules

To drop multiple schedules, nest a <InternalLink path="select-clause">`SELECT` clause</InternalLink> that retrieves `id`(s) inside the `DROP SCHEDULES` statement:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP SCHEDULES WITH x AS (SHOW SCHEDULES) SELECT id FROM x WHERE label = 'schedule_database';
```

```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
DROP SCHEDULES 4
```

In this example, all schedules with the label `schedule_database` are dropped.

## See also

* <InternalLink path="manage-a-backup-schedule">Manage a Backup Schedule</InternalLink>
* <InternalLink path="backup">`BACKUP`</InternalLink>
* <InternalLink path="restore">`RESTORE`</InternalLink>
* <InternalLink path="create-changefeed">`CREATE CHANGEFEED`</InternalLink>
* <InternalLink path="create-schedule-for-changefeed">`CREATE SCHEDULE FOR CHANGEFEED`</InternalLink>
* <InternalLink path="show-backup">`SHOW BACKUP`</InternalLink>
* <InternalLink path="show-schedules">`SHOW SCHEDULES`</InternalLink>
* <InternalLink path="pause-schedules">`PAUSE SCHEDULES`</InternalLink>
* <InternalLink path="resume-schedules">`RESUME SCHEDULES`</InternalLink>
* <InternalLink path="pause-job">`PAUSE JOB`</InternalLink>
* <InternalLink path="pause-job">`RESUME JOB`</InternalLink>
* <InternalLink path="cancel-job">`CANCEL JOB`</InternalLink>
* <InternalLink path="take-full-and-incremental-backups">Take Full and Incremental Backups</InternalLink>
* <InternalLink path="cockroach-sql">Use the Built-in SQL Client</InternalLink>
* <InternalLink path="cockroach-commands">`cockroach` Commands Overview</InternalLink>
