Json_To_GlobalTable

Transforms a JSON string into a global temporary table

  • Free Stored Procedure
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

EXEC SQLHTTP.net.Json_To_GlobalTable @Json, @GlobalTableName, [@Style], [@SuppressMessage]

Arguments:

Name Type Description
@Json nvarchar(MAX) Required. JSON string
@GlobalTableName varchar(100) Required. Name of the global temporary table to be created and populated using this stored procedure
@Style tinyint Optional. Currently two styles are available for slightly different representation of certain column names. Default: 0
@SuppressMessage bit Optional. Boolean indicator what displays or suppresses an output message with alternative SQL Code that does not utilize global temporary tables.

Remarks:

Use this stored procedure sparingly when using Json_To_Xml and then utilizing XQueryHelper is not a good option.

This stored procedure will display a message containing alternative SQL code that DOES NOT utilize temporary global tables. However, since the query relies on ordinal positions of columns, any slight change in the JSON data structure may affect the aliasing of column names. See below.

Sample Usage:

In addition to the above output, the following will be displayed in SSMS Messages tab when @SuppressMessage = 1

See Also: