# How to create dataset for flattend json in sql server

**URL:** <https://community.dremio.com/t/how-to-create-dataset-for-flattend-json-in-sql-server/5986>\
**Category:** Uncategorized\
**Created:** [July 24, 2020, 2:27pm UTC](https://community.dremio.com/t/how-to-create-dataset-for-flattend-json-in-sql-server/5986 "2020-07-24T14:27:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikash\_Singh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vikash_singh/32/1069_2.png) [@Vikash\_Singh](https://community.dremio.com/u/Vikash_Singh)\
**Post date:** [July 24, 2020, 2:27pm UTC](https://community.dremio.com/t/how-to-create-dataset-for-flattend-json-in-sql-server/5986/1 "2020-07-24T14:27:44Z")

</div>

Hi ,

I have flattened column in sql database like in screen-shots ,how can i create dataset so that each field in Schema is seprate coloumn in dremio.do we have any api or refrance for that

eg: i have following json schema in Sql server as colomn ,how can i flattend in dremio so that each field is seprate coloumn here

{“parent”:“47474565-b688-460b-a33d-3495eda82712”,“projectname”:“MR GAT”,“entitytimezone”:“2020-06-25”,“modifieddatetime”:“2020-06-25”,“entityid”:“47474565-b688-460b-a33d-3495eda82712”,“createddatetime”:“2020-06-25”,“uuid”:“47474565-b688-460b-a33d-3495eda82712”,“datestarted”:“2020-06-23”,“projectuom”:“Metric”}

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/e/eb08cd08890a61e5b6e0ad18e57e7e7b67189bb4.png)

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [July 25, 2020, 7:15am UTC](https://community.dremio.com/t/how-to-create-dataset-for-flattend-json-in-sql-server/5986/2 "2020-07-25T07:15:44Z")

</div>

@Vikash_Singh

if you have a list (array) then you can unnest (FLATTEN) and then extract a column, see example below

> SELECT fragmentProfile, nested\_0.fragmentProfile.majorFragmentId AS majorFragmentId  
> FROM (  
> SELECT flatten(fragmentProfile) AS fragmentProfile  
> FROM “@dremio”.“profile-prod” AS “profile-prod”  
> ) nested\_0
