MS SQL code (T-SQL) and json
Budget $10-30 USD
I have the following json:
{
"showRandomSections":false,
"sections":[
{
"questionCount":"1",
"folderId":"e1365655-fbe8-46b5-9568-f7b3edae02f2"
},
{
"questionCount":"1",
"folderId":"c24fb55b-16e1-4158-9cd6-6404588ccc09"
},
{
"questionCount":"2",
"folderId":"e1365655-fbe8-46b5-9568-f7b3edae02f2"
}
]
}
Of course the "sections" array can contain many items (in the example just 3).
I have the following table called [Folders] with 2 columns:
NewID, OldID
BF5C9C6C-00AC-467C-8F47-D1ACE582925A, c24fb55b-16e1-4158-9cd6-6404588ccc09
F44EEDC6-88FD-4886-AEF1-8314A1A11FC4, e1365655-fbe8-46b5-9568-f7b3edae02f2
Basically I need a T-SQL script that replaces in the json all old IDs with the new IDs. In other words, given the json above, I expect the following json as output:
{
"showRandomSections":false,
"sections":[
{
"questionCount":"1",
"folderId":"F44EEDC6-88FD-4886-AEF1-8314A1A11FC4"
},
{
"questionCount":"1",
"folderId":"BF5C9C6C-00AC-467C-8F47-D1ACE582925A"
},
{
"questionCount":"2",
"folderId":"F44EEDC6-88FD-4886-AEF1-8314A1A11FC4"
}
]
}
I don't want to use loops or cursors. Maybe this link can help you, I found it by googling but I'm not sure it can be applied to my case: [login to view URL]
PS: Before bidding please read carefully the requirements.
Thanks.
Awarded to:
Hi, I am interested in your project I have read and understood all your project details and I feel I am the best candidate to complete this project with 100% accuracy. I have a Master’s degree and experience of more More
10 freelancers are bidding on average $42 for this job
Hi, ***** .NET,sql expert***** I have more then 15 year’ experienced in full stack .NET developer in ASP.NET Core / MVC / WinForm, C#, Razor, Jquery, HTML5, Telerik, DevExpress, SQL Server, MySQL, PostgreSQL. As i More
Hi! I've gone through your project details and understood it. If you choose me, I'll provide full satisfaction and best price. Looking forward to discuss more detail about your project. Thanks for reading me.
Hello, I am a web developer, I can easily do your work by PHP Mysql Json. Please start chat for detail. Thanks Jaffer I.
I'm trying to build up my reputation here and this seemed like something simple for me to do. I would like to get the full $30. Below is my proposed solution to your issue. --DROP TABLE #Sections DECLARE @json NVAR More
Hello friend I hope you doing well this days with 4 years python experience I'm more then capable to handle this job I can 100% confirm that you will be very happy and satisfying after testing my work please not thi More