Reply
sudhav
Helper V
Helper V

Need automatic script(Query) for JSON file

Hi Team, 

I have a JSON file, I need automatic script in sql/python for that file, so that i can run that code in my pipeline to copy that file to my lakehouse.

is there any way. please let me know.

TIA

2 REPLIES 2
GraceGu
Microsoft Employee
Microsoft Employee

You can do copy file to file or file to table into lakehouse. Can you elaborate a bit more on "automatic script"? 

Hi Grace,

below is my JSON script

sudhav_0-1689766222863.png

and i have Json table below with name Student(for assumption)

sudhav_1-1689766302171.png

it is having the columns of

studentId,studentName,studentBranch 

and data is 

101      Adam        Finance

102      Scott        Accounts

103     Saran        Finance

104     Aantony   Sales

 

 

so if you want to create the same table in SQL, you need to write one query like below

 

create table Student(studentId int,studentName varchar(50),StudentBranch varchar(50))

insert into Student values(

101      Adam        Finance),

(102      Scott        Accounts),

(103     Saran        Finance),

(104     Aantony   Sales)

 

then the same table will create in SSMS. 

 

so @GraceGu  what I want to achieve here is, that sql script i want to generate automatically from that JSON file/script. in SQL or in Python or pyspark also(in any language) that enough for me.

 

is there any way, please let me know. its very need for me.

 

 

 

 

avatar user

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)