CREATE CONTACT

Creates a new contact or replaces an existing contact.

See also:

ALTER CONTACT , DROP CONTACT , SHOW CONTACTS

语法

CREATE [ OR REPLACE ] CONTACT [ IF NOT EXISTS ] <name>
  [ {
    USERS = ( '<user_name>' [ , '<user_name>' ... ] )
    | EMAIL_DISTRIBUTION_LIST = '<email>'
    | URL = '<url>'
    } ]
  [ COMMENT = '<string_literal>' ]

必填参数

name

指定新联系人的姓名。

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

可选参数

USERS = ( 'user_name' [ , 'user_name' ... ] )

可以联系的 Snowflake 用户列表(以逗号分隔),这些用户通过其用户对象的名称指定。

If the user name is case-sensitive or includes any special characters or spaces, double quotes are required. The double quotes must be enclosed within the single quotes. For example, if the user is joe@example.com, you must specify '"joe@example.com"'.

EMAIL_DISTRIBUTION_LIST = 'email'

A valid email address, which can be a distribution list.

URL = 'url'

可用于就对象与他人联系的 URL。

COMMENT

用户定义的字符串。指定联系人的注释。

访问控制要求

A role used to execute this operation must have the following privileges at a minimum:

权限对象备注
CREATE CONTACT架构

Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

使用说明

  • 关于元数据:

    Attention

    Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.

  • CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.

示例

CREATE CONTACT my_contact
  EMAIL_DISTRIBUTION_LIST = 'support@example.com';