fjtello / SQL-C-sharp

Common programming and coding tips and howtos
0 stars 0 forks source link

#SQL #json #json_value #48

Open fjtello opened 5 years ago

fjtello commented 5 years ago

declare @j as varchar(100); set @j = '[{ "name": "John", "skills": ["SQL", "C#", "Azure"] }, { "name": "Jane", "surname": "Doe" }]';

select @j, JSON_VALUE(@j,'$[0].name'), JSON_VALUE(@j,'$[0].skills[1]')

https://docs.microsoft.com/es-es/sql/relational-databases/json/json-data-sql-server?view=sql-server-2017