Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Vs JSON in SQL Server 2012

Tags:

sql

sql-server

Hi I am having a HTML5 application from where I am reading the values in the JS and then creating its XML using Dictionary in class.

I came up with the blog to Consumethe json INTO SQL directly.

https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/

Please let me know the cost wise views If I moves to the JSON approach leaving the XML behind.

Thanks

like image 842
Sayam Jain Avatar asked Nov 17 '25 18:11

Sayam Jain


1 Answers

If you are thinking performance wise parsing of XML and JSON is not much difference. There are typical use cases where both of these are fit.

Advantages of XML:

  • There's already an industry standard XSD to follow.
  • Validation afforded by creating a new XSD is important to you or your callers.
  • You need to transform the data to another XML form. (XSLT works wonders for transformations.) Or, you have to represent mixed content (tags mixed within text).

Choose JSON if

  • The closer fit to JavaScript is valuable to you or your callers.
  • You prefer a lighter-weight solution.
  • Or, the reasons mentioned above for choosing XML do not apply to you.

For more information go through the blog link JSON Vs XML

like image 177
Abhijeet Dhumal Avatar answered Nov 19 '25 09:11

Abhijeet Dhumal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!