split json data in sql server column

To get the AdventureWorks sample database, download at least the database file and the samples and scripts file from GitHub. Feel free to use the comments section on the post. In the output, we can also notice the message 1 row affected. Now, we want to retrieve the Employees array. use one parameter instead of many parameters in stored procedures or functions. If you must modify parts of JSON text, you can use the JSON_MODIFY (Transact-SQL) function to update the value of a property in a JSON string and return the updated JSON string. JSON documents may have sub-elements and hierarchical data that cannot be directly mapped into the standard relational columns. AdventureWorks2016_EXT. 3.2 Create Datasets. We can use SQL functions such as SQL CONCAT in combination with JSON_QUERY functions. We explored JSON_VALUE() and JSON_MODIFY() functions in my previous articles. It will step through using the built-in functions available to MySQL to create, read, update, and delete rows. Does the double-slit experiment in itself imply 'spooky action at a distance'? You should explore these functions and be familiar with the If it was done using a normalised database, this may involve altering tables, or creating an Entity Attribute Value design, or some other method. An array is an ordered collection of values. The following example updates the value of a property in a variable that contains JSON: You don't need a custom query language to query JSON in SQL Server. I will use the following terms when referring to these: The output table gives more data than you will normally use, but I have found it helpful in debugging input strings and in determining if there are nested objects or arrays. There are several features in SQL Server that make it possible to filter on JSON data. 3 Create JSON using SSIS Export JSON Task. Each nested key name can appear just once per data object type instance. How do we use this to filter our data? Recent improvements in development practices also mean that altering a table is not as major as it was in the past, so adjusting your database once its in production is possible. The OPENJSON function is quite useful if you need to extract or transpose your JSON data into columns. Each name is followed by colon and the name/value pairs are separated by a comma. raise an error in case of any invalid key or value. You could extract the string, do some substring and replacement work on the string, and add it into the field, but thats error-prone and a lot of work. It consists of It eliminates the requirement to specify the JSON attributes. The function that SQL Server uses can also be used in regular SQL, not just in the check constraint. Heres the statement to do that. A quick example: SELECT * FROM STRING_SPLIT('a,b,cd', ','); /* result: value -------- a b cd */. We can also add a constraint to ensure it is valid JSON. I can recommend JsonSelect and json4sql if you want to use existing CLR solutions. One example may be where a user can add custom attributes. As you know, we cannot use the JSON_VALUE() function to retrieve an object or array. How to draw a truncated hexagonal tiling? The other way to delete JSON data is to remove an attribute from a JSON field. It ensures you can only insert valid JSON data into the field. Check Constraints are inspected whenever data is added or updated in the table. Here are some specific use cases that benefit from the JSON support in SQL Server and in SQL Database. Otherwise you wouldn't know what dates should be handled together if the result set contains multiple rows. You can see the whole document as part of the JSON_QUERY() function. Desk {color: black, drawers: [{side: left, height: 30cm}, {side: right, height: 40cm}], material: metal}, Your email address will not be published. Heres what a check constraint would look like: Or, we could add the constraint at the time we create the table: The ISJSON field returns 1 if the specified field is JSON-compliant. This can be useful for data in your tables, or if youre loading JSON from an external source and want to translate it into your database tables. The length of MAX allows up to 2GB of data. We require JSON data import into the SQL Server table from the .json file created earlier. LEFT JOIN vs. LEFT OUTER JOIN in SQL Server. We can use the table value function OPENROWSET for reading data from a file and return a table in the output. One design is to have the web method and the stored procedure to each have the 3 input parameters. You can use both standard table columns and values from JSON text in the same query. It is an optional argument, so we do not However if you must do it as a script transform, I followed the instructions here: https://mycontraption.com/parsing-json-data-sources-using-ssis/and made it work with the following script: #region Help: Introduction to the Script Component /* The Script Component allows you to perform virtually any operation that can be accomplished in The following JSON object string has 5 named/value. We can see that the columns have been split out and are showing separately. There is a function in SQL Server that allows you to update a field quite easily: the JSON_MODIFY function. Applies to: Messages containing errors or warnings about the record. It then validates and sets the variables using the returned table. We can extract a value from the JSON field and display it in a separate column. We can use the JSON_VALUE function in the WHERE clause that we saw earlier in this guide: The execution plan shows a Full Table Scan step, which is a slow type of access. Also, we get to use the various SQL Server JSON functions on the JSON data to make working with it easier. In this article, Phil Factor demonstrates how he takes advantage of JSON when exporting or importing tables. We can run a simple SELECT statement to see the data in the table. Acceleration without force in rotational motion? JSON also supports arrays, which is a collection of records within an object. Lets see an example. The integer value to add to the last value inserted into the id column. In this example the start value for the id column is set to 10 and each following id value increments by 3. For example, you might want to generate JSON output that's compliant with the OData specification. In an array the data itself. Now, we can create an index on this new column. We can run the same SELECT statement as above to see the updated value. Launching the CI/CD and R Collectives and community editing features for Add a column with a default value to an existing table in SQL Server, How to return only the Date from a SQL Server DateTime datatype, How to check if a column exists in a SQL Server table, How to concatenate text from multiple rows into a single text string in SQL Server. Please correct me if I am wrong, Thanks! Sci fi book about a character with an implant/enhanced capabilities who was hired to assassinate a member of elite society. We can run an UPDATE statement with JSON_MODIFY to remove the height attribute. A null value is shown for records that dont have this attribute. The columns from both versions are combined. Am I being scammed after paying almost $10,000 to a tree company not being able to withdraw my profit without paying a fee. We can update the value of color to black by using this JSON_MODIFY function. Lets say we want to add a new attribute name and value, in addition to the color, height, and material that already exist. JSON is a textual format so the JSON documents can be stored in NVARCHAR columns in a SQL Database. Notify me of follow-up comments by email. Its good for when there are multiple attributes: Additional attributes, or name/value pairs, can be added by using a comma to separate them. It also gives you NULL value in the output If we try to get a scalar value from the JSON_QUERY() function. Get my book: Beginning Oracle SQL for Oracle Database 18c, Copyright 2023 Database Star | Powered by Astra WordPress Theme. Have you used JSON fields in SQL Server? The dateStyle option is used to change the default style. This shows us the data in the JSON column, and it looks just like a text value. update test set desk = json_modify(desk, {{{ $.Desk[XX].height = 10cm }}} where {{{$.Desk[XX].side =left}}}, Sample Data But, this demonstrates the concept of creating a virtual column and an index (also that an index is not the right solution every time!). You can copy the JSON and paste it in the JSON formatter. First, lets write the path expression, and then put that into our JSON_VALUE function. Hi! If your line-delimited JSON files are stored in Azure Blob storage or the Hadoop file system, you can use PolyBase to load JSON text, parse it in Transact-SQL code, and load it into tables. Using the method above, we needed to enter the data in exactly the right format. Its similar to HTML or XML it represents your data in a certain format that is readable by people but designed to be readable by applications. The name of the output column is value. In an object, the value portion. Having said all of that, if youre creating virtual columns to be able to access data in SQL Server JSON fields more efficiently just to make your application and database work, then perhaps the JSON field is not right for your database. Other characters sequences that are automatically converted are: @InputString nvarchar(max) (SS2K8) nvarchar(4000) (SS2K). How did Dominion legally obtain text messages from Fox News hosts? My . We might want to raise an error message instead of getting a The @Option parameter is used to change default settings when the function is run. JSON is a viable option for transferring data between systems. If it does not exist, then the attribute will be added, as we saw in the earlier example. From 2016, SQL Server supports to convert JSON data to rows & columns format and vice versa. This should make our query faster. This can be done with the JSON_MODIFY function. We can retrieve the whole JSON document by removing the second argument. Create procedures and views that query JSON data. This will mean that the new value should be added or appended to the end of the array. 1) "\/DATE(" found at position1 but the date is not 13 numeric characters. It can be useful to use strict if you need this for your application. What are some tools or methods I can purchase to trace a water leak? bracket. How does this help? If you have JSON text that's stored in database tables, you can read or modify values in the JSON text by using the following built-in functions: In the following example, the query uses both relational and JSON data (stored in a column named jsonCol) from a table: Applications and tools see no difference between the values taken from scalar table columns and the values taken from JSON columns. You can use FOR JSON to format the output as expected in SQL Server. We'll explore the basics of how to use a FOR JSON clause to return data in the JSON format, using either the AUTO argument or the PATH argument. Each file will be a separate row in the table.Ideally, inserting the following files would give me a table with three rows where JSON_DATA Now you can combine classic relational columns with columns that contain documents formatted as JSON text in the same table, parse and import JSON documents in relational structures, or format relational data to JSON text. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. The output observes the following rules: For more information, see Convert JSON Data to Rows and Columns with OPENJSON (SQL Server) and OPENJSON (Transact-SQL). The offset in the input string that the element was found. If you can get rid of XML in favor of JSON - do it! We provide a JSON field and a path expression. We can then select the data from the table again to see that it has been removed: The attribute of height is no longer in the JSON field. Create and run procedures that export the content of the Person and the SalesOrder tables as JSON results, and import and update the Person and the SalesOrder tables by using JSON input. You can return the first object using [0]: The second object can be found using [1], the third object using [2], and so on. Since NVARCHAR type is supported in all SQL Server subsystems you can put JSON documents in tables with CLUSTERED COLUMNSTORE indexes, memory optimized tables, or external files that can be read using OPENROWSET or PolyBase. This is available in some records but not others. This determines how to treat path values that dont exist. The good thing with this is that any application can easily read this field and work with it how they want (display it, filter it, and so on). Microsoft is migrating content formerly on Channel 9 to a new platform. Ways to Split delimited column into multiple rows Method 1. A Function to Split JSON Data - SQLServerCentral A Function to Split JSON Data Ric Vander Ark, 2009-09-23 JSON stands for JavaScript Object Notation, and is a lightweight data-interchange. If the remaining columns are added to the query (add j. The color is a part of the attributes JSON column in our table. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Formatting and escaping are handled by SQL Server. How can I pretty-print JSON in a shell script? How to delete all UUID from fstab but not the UUID of boot filesystem. Clean up scripts. This function is called ISJSON. Required fields are marked *. If removeQuotes =1 and surrounding double quotes are detected, then the surrounding double quotes are removed and the control pattern \" is replaced with a ". The open-source game engine youve been waiting for: Godot (Ep. We get an object or an array from the JSON. It retrieves a scalar value Let us have a JSON placed in an external file and its contents are Select * FROM OPENJSON (@JSON) If the remaining columns are added to the query (add j. Search by the Primary Key and other fields. Parsing JSON data in Unicode is 5-15% faster. Because drawer is an array, we cant use the dot notation to get the attribute like this: This will return a null value as there is no attribute called side: its part of an array. The JSON_MODIFY function syntax looks like this: The function returns the updated JSON string. Other alternative for older version of SQL Server is to use XML instead of JSON and use nodes() function. from a JSON string. We can see the differences in the results using the JSON_QUERY function. At the same time, JSON is used by the NoSQL (Microsoft Azure Cosmos DB, CouchDB, etc.) Often we need to filter on one of the keys or values. Would the reflected sun's radiation melt ice in LEO? Double-click on the Script Component, go to the Inputs and Outputs tab. JSON is a popular textual data format that's used for exchanging data in modern web and mobile applications. So, using the JSON_VALUE function in the WHERE clause will mean a full table scan is used. Transferring Data with JSON in SQL Server, Format Query Results as JSON with FOR JSON. It becomes necessary for SQL database administrators as well to understand JSON and use SQL Server function in The INSERT statements will work, and the data will look like this: Once youve got some JSON data in a table, the next step is to read it. The application puts data in and reads data from it, and the database doesnt care about whats inside the field. We do this using a combination of "path expressions" and the JSON_VALUE function. rev2023.3.1.43266. now. This is done using the WITH clause in your SELECT query. SQL Server includes a function that lets you expand the JSON fields and display them in a table. Is there a colloquial word/expression for a push that helps you to start to do something? steps to prepare the same database. The result is 1 so its a valid JSON value. How to Easily Parse and Transform JSON in SQL Server | by Eric Kleppen | Level Up Coding 500 Apologies, but something went wrong on our end. Follow these steps: Click import schemas Make sure to choose value from Collection Reference Toggle the. So, given that you can add JSON columns to tables, extract fields, and get all the flexibility of JSON fields with validation, wouldnt it be better to just store all of your data in JSON fields rather than normalised tables? Javascript object Notation. zero-based indexing process, and we can specify the second argument $.Employees[1]. * to the select list) the non-split values in the other columns are duplicated. It starts with a $ symbol, and we specify a dot then the name of the attribute were looking for. It is an ordered list of values to store multiple values. This new attribute would be width, and the value is 100cm. If we select the data from the table, this is what we see: The JSON data is shown exactly as we entered it. For more information, see Index JSON data. Using Simple method 2. If there is a further split of 1 values into 2, then there are 4 rows, and so on. In SQL Server 2016 you would be able to define schema at query time when you open json: Note that you cannot have dynamic return schema - you need to specify what fields should be returned in TVF. The default style is 121. Now you can combine classic relational columns with columns that contain documents formatted as JSON text in the same table, parse and import JSON documents in relational structures, or format relational data to JSON text. You can click on the JSON hyperlink and it gives you JSON as shown below. For example, to specify the color attribute, out path expression would look like this: To specify the material attribute, we can use this path expression: If we had a height attribute enclosed in a dimensions attribute, our path expression would look like this: We use the dot to specify the next level in the hierarchy of attributes. Do flight companies have to make it clear what visas you might need before selling you tickets? Can patents be featured/explained in a youtube video i.e. The OPENJSON rowset function converts JSON text into a set of rows and columns.After you transform a JSON collection into a rowset with OPENJSON, you can run any SQL query on the returned data or . How is "He who Remains" different from "Kang the Conqueror"? We can select from this table and see the record is updated: The example above showed how to update an existing key or value in a JSON field. It uses a combination of different brackets, colons, and quotes to represent your data. In this article, we will explore JSON_QUERY() functions in SQL Server to extract JSON objects and array from the You can organize collections of your JSON documents in tables, establish relationships between them, combine strongly typed scalar columns stored in tables with flexible key/value pairs stored in JSON columns, and query both scalar and JSON values in one or more tables by using full Transact-SQL. An object is an unordered set of name/value pairs. We will update the links as the videos are migrated to the new platform. Convert Results Using AUTO Mode This is the simplest way to convert relational data into a JSON format as all that you have to do is to add FOR JSON AUTO clause at the end of your SELECT statement. This will insert a new product that has an array of drawers. First, we use the $ argument in the second parameter, and we get the complete JSON string, as shown below. First, we create a new column that contains the color attribute: We can select from the product table to see it. The result is 0 so its not a valid JSON value. Lets use the JSON_VALID function to check. The easiest is to use a string splitter that cracks the the list into table format and which also returns the list position: WITH splitting AS SELECT t.SrNo, t.Name, s.Code, s.ListPos FROM tbl t CROSS APPLY dbo.splitfun(t.Code)) SELECT SrNo, Name MIN (CASE ListPos WHEN 1 THEN Code END) AS Code1, MIN (CASE ListPos WHEN 2 THEN Code END) AS Code2, MIN (CASE ListPos WHEN 3 THEN Code END) AS Code3 . I ran the following script for each version. So the result I am looking for like: If this is not possible with native SQL Server mechanisms, maybe PostgreSQL can do it, or other RMDBS, PS. Column [source] Returns a new row for each element in the given array or map. JSON is not a replacement for existing relational models, however. Every sub-object can be parsed using additional OPENJSON function call: The skills array is returned in the first OPENJSON as original JSON text fragment and passed to another OPENJSON function using APPLY operator. Heres how to insert an array by just specifying it in a JSON format. JSON functions, first introduced in SQL Server 2016, enable you to combine NoSQL and relational concepts in the same database. This OData URL represents a request for the ProductID and ProductName columns for the product with ID 1. key:value pairs will not be returned as column:cell - each key:value pair will be returned in a separate rows: This will be also available in Azure SQL Database soon. SQL Server can also format query results in any format, such as OData JSON or GeoJSON. So youve learned a bit about JSON data and why you might want to use it. sathya - My blog ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **. Well, sometimes that might be a good idea. String_Split To use the default settings the call is: To set the options dateStyle and idStart the call is: Notice that we only need to just pass in the options we want to set (2 in the example above), not all of them. allow for dynamic setting of T-SQL variables in stored procedures and functions. The name is username and the value is sstorm. We can add a Check Constraint to the table to ensure the data is valid. We can also use the $ argument to get the whole JSON string. So why would you use JSON data in your database? fnSplitJson2 then calls itself with the @Options as the @InputString. This is the concept of a black box. You provide it with a value, and it returns 1 if its a valid JSON string and 0 if it is not. Values are separated by a comma. Showing JSON Columns as Table Columns with a Schema. Notice that the values in the SQL 2000 value column have rounded the milliseconds. Is there a way to only permit open-source mods for my video game to stop plagiarism or at least enforce proper attribution? Defined Function 5. JSON is also the main format for exchanging data between webpages and web servers by using AJAX calls. Now, the first function, which uses STRING_SPLIT , needs ROW_NUMBER () to generate the seq output. However, its quite easy to get attributes and values out of this text field and display them. To learn more, see our tips on writing great answers. conjunction with JSON. And that covers the basics of what JSON is. JSON is flexible and quite powerful, but just because you can store data in a JSON field, doesnt mean you should. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. If we try to retrieve the scalar value using While there are functions for reading from and working with the JSON field, it might be better to just store the JSON data in the field, retrieve it from your application, and process it there. Simple SELECT statement to see the data in Unicode is 5-15 % faster if we try to get a value... Key or value in any format, such as SQL CONCAT in combination JSON_QUERY. As JSON with for JSON method 1 for example, you might want to use instead. Return a table in the results using the with clause in your SELECT query filter on one of the function. Delimited column into multiple rows method 1: Godot ( Ep between systems column... Transpose your JSON data and why you might need before selling you tickets the! Specific use cases that benefit from the JSON_QUERY ( ) function to black by AJAX... You JSON as shown below there a way to only permit open-source mods for my video game to plagiarism... Scalar value from collection Reference Toggle the of XML in favor of JSON and use nodes ( ).... A separate column but just because you can use the table value function for! Sun 's radiation melt ice in LEO might need before selling you tickets the message row! Word/Expression for a push that helps you to combine NoSQL and relational concepts in the output as in... Am wrong, Thanks about the record me if I am wrong, Thanks be directly mapped into SQL... Conqueror '' colloquial word/expression for a push that helps you to combine NoSQL and relational concepts in earlier! The variables using the returned table other way to delete JSON data can get of. New column that contains the color is a collection of records within object... Stored procedures and functions to insert an array from the JSON formatter looking for this JSON_MODIFY function,... By the NoSQL ( Microsoft Azure Cosmos DB, CouchDB, etc. like! Use for JSON to format the output expressions & quot ; path expressions & quot path. The JSON_MODIFY function of T-SQL variables in stored procedures and functions JSON_MODIFY to remove the height attribute easily: JSON_MODIFY. Updates, and the database file and the samples and scripts file from GitHub starts with $! Server can also use the various SQL Server supports to convert JSON data in modern web mobile. In this article, Phil Factor demonstrates how he takes advantage of JSON - split json data in sql server column... Been waiting for: Godot ( Ep the product table to ensure the data in and reads from. Value function OPENROWSET for reading data from it, and the JSON_VALUE function featured/explained in a youtube video i.e a... Transferring data with JSON in SQL Server JSON functions, first introduced in Server! Delete all UUID from fstab but not the UUID of boot filesystem add... It then validates and sets the variables using the returned table data and why might. Result is 1 so its not a replacement for existing relational models, however OData JSON or GeoJSON uses! Your data also format query results in any format, such as SQL CONCAT in combination with functions. On one of the attribute will be added or appended to the query add... Heres how to delete all UUID from fstab but not others do it source ] returns new. Text field and a path expression your database rows & amp ; columns format and vice.! Am wrong, Thanks in LEO a character with an implant/enhanced capabilities who was hired to a... Database doesnt care about whats inside the field the returned table color is a viable option for data! Document as part of the array using AJAX calls stored in NVARCHAR columns in JSON. Delimited column into multiple rows method 1 DB, CouchDB, etc. the NoSQL ( Azure! Script Component, go to the query ( add j returned table height attribute latest features security... Sample database, download at least the database doesnt care about whats inside the field game engine been. Click on the script Component, go to the last value inserted into SQL! It then validates and sets the variables using the JSON_QUERY ( ) function you! Starts with a Schema clear what visas you might need before selling you tickets nested key name can just. Added or appended to the last value inserted into the id column is set 10! Nested key name can appear just once per data object type instance featured/explained a! Date is not 13 numeric characters JOIN in SQL Server split json data in sql server column, enable you to combine and., doesnt mean you should object type instance function OPENROWSET for reading data from,... Now, the first function, which uses STRING_SPLIT, needs ROW_NUMBER ( ) and JSON_MODIFY ( ).! Store data in your SELECT query because you can Click on the script Component, to. Remove the height attribute the product table to ensure the data is added or in... 'S used for exchanging data in the table to see the updated JSON string separate. Of boot filesystem constraint to ensure the data in the table Phil demonstrates. Heres how to delete all UUID from fstab but not the UUID of boot filesystem without a! By a comma statement as above to see it field quite easily: the JSON_MODIFY function of name/value pairs benefit... As part of the latest features, security updates, and it looks just like a text.! The height attribute not others expressions & quot ; and the stored procedure to have..., and it gives you JSON as shown below video game to stop or... The values in the check constraint to the table been waiting for Godot... The JSON_VALUE function he who Remains '' different from `` Kang the Conqueror '' following value! Previous articles this attribute specifying it in a shell script ) `` \/DATE ( `` at! For example, you might want to use XML instead of many parameters in stored procedures functions... Are migrated to the Inputs and Outputs tab the complete JSON string of drawers NoSQL relational! That can not be directly mapped into the SQL Server and in Server... Used by the NoSQL ( Microsoft Azure Cosmos DB split json data in sql server column CouchDB,.! New platform WordPress Theme is 0 so its not a valid JSON value with the @ InputString not others post! Script Component, go to the query ( add j columns have split! That might be a good idea eliminates the requirement to specify the second argument am I being scammed paying. Reads data from a JSON format you provide it with a $ symbol, and technical.! Demonstrates how he takes advantage of JSON and use nodes ( ) and JSON_MODIFY ( ) to JSON! Use strict if you need to filter our data this new column from GitHub @ InputString attribute! We need to filter our data value to add to the new platform paste this URL into RSS. Lets you expand the JSON and paste this URL into your RSS reader generate JSON output that used. I being scammed after paying almost $ 10,000 to a tree company not being able withdraw. Flexible and quite powerful, but just because you can only insert JSON... The comments section on the JSON hyperlink and it gives you JSON shown., read, update, and the JSON_VALUE ( ) functions in my previous.... One example may be where a user can add a constraint to ensure data! Check constraint to the SELECT list ) the non-split values in the output to a company! Was hired to assassinate a member of elite society sometimes that might be a good idea a option. Whenever data is added or updated in the output as expected in SQL Server includes a function the..., JSON is if I am wrong, Thanks mods for my video game to stop plagiarism or at the., not just in the output are several features in SQL Server that make it clear what you.: Messages containing errors or warnings about the record shown for records that dont.! Not a replacement for existing relational models, however on one of the attribute will be added updated. For: Godot ( Ep from it, and we get an object or an array of drawers index... Pairs are separated by a comma an array by just specifying it in a youtube video i.e a bit JSON... Remains '' different from `` Kang the Conqueror '' argument to get attributes and values out of this text and... About a character with an implant/enhanced capabilities who was hired to assassinate a of. The built-in functions available to MySQL to create, read, update, and the name/value pairs are by. Nodes ( ) and JSON_MODIFY ( ) function separate column we saw in second... Which uses STRING_SPLIT, needs ROW_NUMBER ( ) and JSON_MODIFY ( ) function ''! And paste it in a JSON field and display them in a table in the results using the returned.! Want to generate the seq output columns with a Schema covers the basics of what JSON is path &! This RSS feed, copy and paste this URL into your RSS.! The open-source game engine youve been waiting for: Godot ( Ep inserted the. Open-Source mods for my video game to stop plagiarism or at least enforce proper attribution more, see tips... Can patents be featured/explained in a SQL database \/DATE ( `` found at position1 the! Need to extract or transpose your JSON data in the same split json data in sql server column, JSON also. Video game to stop plagiarism or at least the database doesnt care about whats inside the.. So on and technical support can copy the JSON field, doesnt mean you should why would use! You can use the table the color is a viable option for transferring data with JSON in database!