USE WORKSPACE
On this page
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_: ID or name of the workspace to use.name -
group_,id group_: ID or name of the workspace group that contains the workspace.name -
database_: Name of the SingleStore database to connect with.name
Remarks
-
The
WITH DATABASEclause specifies the default database for the current session. -
Specify
@@CURRENTto connect to a database in the current workspace.For example: 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.
USE WORKSPACE 'examplews' WITH DATABASE 'dbTest';
Last modified: December 10, 2025