Join us for a live demo and deep-dive of Instant SQL on May 14Register Now

Skip to main content

LIST SHARES

The LIST SHARES statement lists all shares created by the current user.

It provides the same information as querying the MD_INFORMATION_SCHEMA.OWNED_SHARES view. You can also use the table function md_list_database_shares() for a subset of this information.

tip

To see shares that have been shared with you (by others), query the MD_INFORMATION_SCHEMA.SHARED_WITH_ME view instead.

Syntax

-- Using DDL (lists all owned shares with details)
LIST SHARES;

-- Equivalent to querying the information schema view
SELECT * FROM MD_INFORMATION_SCHEMA.OWNED_SHARES;

-- Using table function (returns a subset of columns)
SELECT name, url, source_db_name FROM md_list_database_shares();

Output

The LIST SHARES statement and SELECT * FROM MD_INFORMATION_SCHEMA.OWNED_SHARES return a table with the following columns:

Column NameData TypeValue
NAMESTRINGThe name of the share
URLSTRINGThe share_url which can be used to attach the share
SOURCE_DB_NAMESTRINGThe name of the database where this share was created from
SOURCE_DB_UUIDUUIDUUID of the database where this share was created from
ACCESSSTRINGWhether anyone (UNRESTRICTED) or only organization members (ORGANIZATION) can attach to the share by its share_url. RESTRICTED shares are hidden from the list.
VISIBILITYSTRINGWhether the share is DISCOVERABLE or HIDDEN
UPDATESTRINGThe share's update mode (MANUAL vs. AUTOMATIC)
CREATED_TSTIMESTAMPThe share's creation time