Færdiggjort

MS SQL code (T-SQL) and json

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.

Evner: Microsoft SQL Server, SQL, JSON, T-SQL (Transact Structures Query Language)

About the Client:
( 120 bedømmelser ) Bologna, Italy

Projekt ID: #32694119

Tildelt til:

kariithijoseph01

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 Flere

$20 USD in 3 dage
(0 bedømmelser)
0.0

10 freelancere byder i gennemsnit $42 timen for dette job

devbaloni1983

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 Flere

$20 USD in 7 dage
(12 bedømmelser)
4.8
(16 bedømmelser)
3.9
NykytaShorst

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.

$20 USD in 2 dage
(1 bedømmelse)
2.6
(2 bedømmelser)
2.8
bizmanas

Hi I have 15 years of experience in SQL server Database development, MySQL development, postgress SQL development, Python,C#, power bi. I will be able to help you with the project. Please ping me offline to discuss fur Flere

$167 USD in 3 dage
(7 bedømmelser)
2.9
mdjafferali

Hello, I am a web developer, I can easily do your work by PHP Mysql Json. Please start chat for detail. Thanks Jaffer I.

$30 USD på 1 dag
(3 bedømmelser)
1.9
cfetterolf

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 Flere

$30 USD på 1 dag
(1 bedømmelse)
1.8
HussamF132

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 Flere

$10 USD in 2 dage
(0 bedømmelser)
0.0
asifhakim

I have more than 14 year experience in software developer and i am expert in writing complex and efficient sql queries and worked in big company veripark,softronic system and planstreet, i am very much interested to do Flere

$20 USD på 1 dag
(0 bedømmelser)
0.0