Home » Science & Technology » How to load JSON file to SQL Server?

How to load JSON file to SQL Server?

Written By Coding Studio on Sunday, Jul 03, 2022 | 10:28 AM

 
Demonstrates how JSON document can be loaded to SQL Server. T-SQL SCRIPT: declare @json_data varchar(max) select @json_data = BulkColumn from openrowset ( BULK 'C:\temp\test.json', SINGLE_CLOB ) as datasource --print @json_data insert into emp (emp_name, emp_address,phone, age) select Name, Address, Phone, Age from openjson (@json_data) WITH ( Name varchar(20), Address varchar(20), Phone varchar(20), Age int ) select * from emp Hope, it was helpful. Thanks you! Next video: Convert JSON to CREATE TABLE Statements #json #sqlservertutorial #sqlserver #sqlservermanagementstudio