Skip to main content

CREATE SHARE

Introduced or updated: v1.2.949
ENTERPRISE EDITION FEATURE
Data Sharing is an Enterprise Edition feature. Contact Databend Support for a license.

Creates a Share in the provider tenant.

Syntax​

CREATE [ OR REPLACE ] SHARE [ IF NOT EXISTS ] <share_name>
[ CONNECTION = <connection_name> ]
[ COMMENT = '<comment>' ]
ParameterDescription
share_nameThe name of the Share. The name must be unique in the tenant.
CONNECTIONA connection in the provider tenant. Its storage type must be the same as the storage type of the tables that you grant.
COMMENTA description of the Share.

Usage Notes​

  • A new Share does not grant objects or consumer accounts. Use GRANT TO SHARE and ALTER SHARE.
  • You can create a Share without a connection. Set a connection before you grant tables or add consumer accounts.
  • You cannot use OR REPLACE and IF NOT EXISTS in the same statement.
caution

OR REPLACE creates a new Share. The shared databases of the consumers stop operation. Do not use OR REPLACE to change credentials. Use ALTER SHARE ... SET CONNECTION.

For the privileges, see Access Control.

Examples​

CREATE SHARE sales_share
CONNECTION = share_conn
COMMENT = 'Shared order data';
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today