Built-in functions

Aggregate

TransactSQL

Snowflake

Notes

APPROX_COUNT_DISTINCT

APPROX_COUNT_DISTINCT

AVG​

AVG

CHECKSUM_AGG

*to be defined

COUNT

COUNT

COUNT_BIG

*to be defined

GROUPING

GROUPING

GROUPING_ID

GROUPING_ID

MAX

MAX

MIN

MIN

STDEV

STDDEV, STDEV_SAMP

STDEVP

STDDEV_POP

SUM

SUM

VAR

VAR_SAMP

VARP

VAR_POP​

Analytic

TransactSQLSnowflakeNotes

CUME_DIST

CUME_DIST

FIRST_VALUE

FIRST_VALUE

LAG

LAG

LAST_VALUE

LAST_VALUE

LEAD

LEAD

PERCENTILE_CONT

PERCENTILE_CONT

PERCENTILE_DISC

PERCENTILE_DISC

PERCENT_RANK

PERCENT_RANK

Collation

TransactSQLSnowflakeNotes

COLLATIONPROPERTY

*to be defined

TERTIARY_WEIGHTS

*to be defined

Configuration

TransactSQLSnowflakeNotes

​@@DBTS

*to be defined

@@LANGID

*to be defined

@@LANGUAGE

*to be defined

@@LOCK_TIMEOUT

*to be defined

@@MAX_CONNECTIONS

*to be defined

@@MAX_PRECISION

*to be defined

@@NESTLEVEL

*to be defined

@@OPTIONS

*to be defined

@@REMSERVER

*to be defined

@@SERVERNAME

CONCAT('app.snowflake.com', CURRENT_ACCOUNT( ))

@@SERVICENAME

*to be defined

@@SPID

*to be defined

@@TEXTSIZE

*to be defined

@@VERSION

*to be defined

Can be mimicked by using CURRENT_VERSION

Conversion

TransactSQLSnowflakeNotes

CAST

CAST

Returns NULL if the value isn't a number, otherwise returns the numeric value as its. When using operators such as <, >, =, <> then must be follow by a NULL

CONVERT

Check CONVERT

Same behavior as CAST

PARSE

*to be defined

TRY_CAST

TRY_CAST

Returns NULL if the value isn't a number, otherwise returns the numeric value as its. When using operators such as <, >, =, <> then must be follow by a NULL

*to be defined

Same behavior as TRY_CAST

TRY_PARSE

TRY_CAST

Behavior may be different when parsing an integer as date or timestamp.

Cryptographic

TransactSQLSnowflakeNotes

ASYMKEY_ID

*to be defined

ASYMKEYPROPERTY

*to be defined

CERTENCODED

*to be defined

CERTPRIVATEKEY

*to be defined

DECRYPTBYASYMKEY

*to be defined

DECRYPTBYCERT

*to be defined

DECRYPTBYKEY

*to be defined

DECRYPTBYKEYAUTOASYMKEY

*to be defined

DECRYPTBYKEYAUTOCERT

*to be defined

DECRYPTBYPASSPHRASE

_*to be defined_​

Can be mimicked by using DENCRYPT_RAW

ENCRYPTBYASYMKEY

*to be defined

ENCRYPTBYCERT

*to be defined

ENCRYPTBYKEY

*to be defined

ENCRYPTBYPASSPHRASE

*to be defined

Can be mimicked by using ENCRYPT_RAW

HASHBYTES

MD5, SHA1, SHA2

Currently only supported separated hash. Use proper one according to the required algorithm

MD5, is a 32-character hex-encoded

SHA1, has a 40-character hex-encoded string containing the 160-bit

SHA2, a hex-encoded string containing the N-bit SHA-2 message digest. Sizes are:

224 = SHA-224

256 = SHA-256 (Default)

384 = SHA-384

512 = SHA-512

IS_OBJECTSIGNED

*to be defined

KEY_GUID

*to be defined

KEY_ID

*to be defined

KEY_NAME

*to be defined

SIGNBYASYMKEY

*to be defined

SIGNBYCERT

*to be defined

SYMKEYPROPERTY

*to be defined

VERIGYSIGNEDBYCERT

*to be defined

Cursor

TransactSQLSnowflakeNotes

@@CURSOR_ROWS

*to be defined

@@FETCH_STATUS

*to be defined

CURSOR_STATUS

*to be defined

Data type

TransactSQLSnowflakeNotes

DATALENGTH

OCTET_LENGTH

​Snowflake doesn’t use fractional bytes so length is always calculated as 8 * OCTET_LENGTH

IDENT_SEED

*to be defined

IDENT_CURRENT

*to be defined

IDENTITY

*to be defined

IDENT_INCR

*to be defined

SQL_VARIANT_PROPERTY

*to be defined