Recently I'm going to have an automated OPS platform, so I'm looking at Django's knowledge.In the actual project development, encountered a small problem: the front and back end of the data interaction is the main use of JSON. Front-end data to the server side of the simple, slightly troublesome is the server-side transfer JSON to the front-end.First, the data is retrieved from the database, and Django uses
Label:No good tool found, only thought of the way to spell the string, with NVARCHAR(MAX) may have truncated, deprecated, the method uses the for XML PATH (" ) Implementation, refer here for its use method Table structure: SQL statements: SELECT '{"id":'+CONVERT(NVARCHAR( -), id)+', "AreaCode":'+AreaCode+', "AreaName": "'+AreaName+'" ," Paremt_areacode ":'+Paremt_areacode+'},' fromHk_dic_countrycode forXML PATH ("') Execution Result: After f
Source: Multi-layered parsing problems encountered when parsing with JSON parameters in SQL Server 2017To develop a new system, the DB section uses the JSON parsing method that SQL Server comes with from version 2016.Used for almost half a year, in individual projects, as well as part of the company's projects, and for
(Newtonsoft.Json.JsonConvert.SerializeObject (Recursive (0, Li));8}This Newtonsoft.Json.JsonConvert.SerializeObject () serialization is what I said when I went to csdn to see someone else's answer, this is something that someone else encapsulated, downloaded from GitHub, downloaded and put in the project, Click "Add Reference" in the project, then select "Browse" to find the DLL in your project, and then this is the case:The following SQL is my own s
Sometimes the need to export data from SQL Server to other departments may be correlated or analyzed, which is of course very simple for SSIS, but many times it takes a lot of time to simply export the data and create an SSIS package that makes a fuss, while the SQL The Import and Export tool for the server where the bugs are still pretty much, the simplest way is bcp. Data export to XMLAfter
easily be imported into other systems.
Data exported as JSON
If you want to export data from SQL Server to JSON, although this operation already has a very mature approach in your application, SQL Server does not natively support this approach (gossip, the next version will support). I recommend the way to use
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.