The ISJSON(…, <type constraint>) Function


BigQueryDb2 (LUW)DuckDBH2MariaDBMySQLOracle DBPostgreSQLSQL ServerSQLite2009201120132015201720192021202320253.9.1 - 3.51.0JSON_VALID(…)ALT↗2022 - 2025b2016 - 2019ab16 - 18… Is Json [Array|Object|Scalar]ALT↗12cR1 - 23.26.1… Is Json [Array|Object|Scalar]ALT↗5.7 - 9.6.0JSON_VALID(…)ALT↗10.2 - 12.2.2JSON_VALID(…)ALT↗1.4.200 - 2.4.240… Is Json [Array|Object|Scalar]ALT↗1.0.0 - 1.4.0JSON_VALID(…)ALT↗2.0SAFE.PARSE_JSON(…) to Test for Valid JSONALT↗
  1. ⚡Does not recognize JSON scalars as valid JSON
  2. No type constraints: … is json [array|object|scalar]

The isjson function returns 1 if the argument string contains valid JSON. Otherwise it returns null if the input was null or 0 for any non-null non-JSON value.

SQL Server 2025abisjson(…)isjson(…, value)isjson(…, array)isjson(…, object)isjson(…, scalar)
  1. Differs from standard SQL is json: 1 for JSON arrays and objects only
  2. Differs from standard SQL is json: 1 for JSON numbers and strings only

Similar to the is json test of standard SQL isjson allows objects to contain the same key several times.

{"a": 42,
 "a": 1}
SQL Server 2025like without unique keyslike with    unique keys
Product Documentation
Standard SQL Features
Non-Standard Alternatives
Tutorials

Normative References

The isjson function is not covered by the international SQL standard ISO/IEC 9075-2:2023.

You can’t catch up on 20 years of SQL evolution in one day. Subscribe the newsletter via E-Mail, Bluesky or RSS to gradually catch up and to keep modern-⁠sql.com on your radar.

About the Author

Photo of Markus Winand

Markus Winand provides insights into SQL and shows how different systems support it at modern-sql.com. Previously he made use-the-index-luke.com, which is still actively maintained. Markus can be hired as trainer, speaker and consultant via winand.at.

Buy the Book

Cover of “SQL Performance Explained”: Squirrel running on grass

The essence of SQL tuning in 200 pages

Buy now!
(paperback and/or PDF)

Paperback also available at Amazon.com.

Hire Markus

Markus offers SQL training and consulting for developers working at companies of all sizes.
Learn more »

Connect with Markus Winand

Subscribe mailinglistsSubscribe the RSS feedMarkus Winand on LinkedInMarkus Winand on XINGMarkus Winand on MastodonMarkus Winand on Bluesky
Copyright 2015-2026 Markus Winand. All righs reserved.
Legal | Contact | NO WARRANTY | Trademarks | Privacy and GDPR