-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDevelopmentScript.sql
69 lines (55 loc) · 1.58 KB
/
DevelopmentScript.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
DECLARE @SourceJSON NVARCHAR(MAX)
DECLARE @TargetJSON NVARCHAR(MAX)
/*
SET @SourceJSON = '{
"list": ["a", "b", "c", {"listx": ["d", "e"]}]
}'
SET @TargetJSON = '{
"list": ["a", "b", {"listx": ["e", "d"]}, "c"]
}'
SET @SourceJSON = '{
"list": [{"a":"1"}, {"b":"2"}],
"list": [{"a":"1"}, {"b":"2"}]
}'
SET @TargetJSON = '{
"list": [{"a":"1"}, {"b":"2"}],
"list": [{"b":"2"},{"a":"1"}]
}'
SET @SourceJSON = '{
"list": ["a", "b", "c", {"listx": ["d", "e"], "listy": ["f"]}]
}'
SET @TargetJSON = '{
"list": ["a", "b", {"listx": ["d", "e"], "listy": ["f"]}, "c"]
}'
SET @SourceJSON = '{
"question": "What is a clustered index?",
"options": [
"A bridal cup used in marriage ceremonies by the Navajo indians",
"a bearing in a gearbox used to facilitate double-declutching",
"An index that sorts and store the data rows in the table or view based on the key values"
],
"answer": 3
}'
SET @TargetJSON = '{
"question": "What is a clustered index?",
"options": [
"a form of mortal combat referred to as ''the noble art of defense''",
"a bearing in a gearbox used to facilitate double-declutching",
"A bridal cup used in marriage ceremonies by the Navajo indians",
"An index that sorts and store the data rows in the table or view based on the key values"
],
"answer": 4
}'
*/
SET @SourceJSON = '{
"ID": 9257,
"BirthTown": "Praha 55",
"City": "Praha"
}'
SET @TargetJSON = '{
"ID": 9257,
"BirthTown": "Praha",
"City": "Praha"
}'
SELECT * FROM dbo.Compare_JsonObject(@SourceJSON, @TargetJSON);
SELECT * FROM dbo.JSONDifference(@SourceJSON, @TargetJSON);