# USE WORKSPACE

Changes the current workspace and database in the notebook.

## Syntax

```
USE WORKSPACE { ID '<workspace_ID>' | '<workspace_name>' | @@CURRENT } 
   [ IN GROUP { ID '<group_id>' | '<group_name>' } ]
   [ WITH DATABASE 'database_name' ]
```

## Arguments

* `workspace_ID`, `workspace_name`: ID or name of the workspace to use.
* `group_id`, `group_name`: ID or name of the workspace group that contains the workspace.
* `database_name`: Name of the SingleStore database to connect with.

## Remarks

* The `WITH DATABASE` clause specifies the default database for the current session.
* Specify `@@CURRENT` to connect to a database in the current workspace. For example:
  ```sql
  USE WORKSPACE @@CURRENT WITH DATABASE dbTest;
  ```
* SingleStore recommends using this command only in interactive notebooks. It may not function as intended in scheduled notebooks.

## Example

The following command sets the current workspace and database to **examplews** and **dbTest**, respectively.

```sql
USE WORKSPACE 'examplews' WITH DATABASE 'dbTest';
```

***

Modified at: December 10, 2025

Source: [/cloud/reference/fusion-sql/use-workspace/](https://docs.singlestore.com/cloud/reference/fusion-sql/use-workspace/)

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