Search
 
SCRIPT & CODE EXAMPLE
 

SQL

insert json file to mssql

Declare @JSON varchar(max)
SELECT @JSON=BulkColumn
FROM OPENROWSET (BULK 'path to json file', SINGLE_CLOB) import 
-- E.g Path: C:UsersxxxDownloadsData.json

INSERT INTO Person (id, name, surname, age, dateOfBirth)
 SELECT id, firstNAme, lastName, age, dateOfBirth 
 FROM OPENJSON(@json)
 WITH (id int,
       firstName nvarchar(50), lastName nvarchar(50), 
       age int, dateOfBirth datetime2)
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle datafile max size 32gb 
Sql :: oracle merge insert if not exists 
Sql :: postgresql array to rows 
Sql :: mysql varchar length 
Sql :: dump db only triggers mysql 
Sql :: rownum in sql 
Sql :: 0 
Sql :: max mysql 
Sql :: psql store procedure-return multiple table values 
Sql :: truncate table sql server foreign key 
Sql :: get month from date sql server 
Sql :: mysql calcular idade 
Sql :: change column in mysql 
Sql :: how to put 0 or 000 depending IDCustomer length in sql server 
Sql :: list all functions and procedures in postgres query 
Sql :: mysql select first 10 entries 
Sql :: mysql regex select 
Sql :: foreign key sql 
Sql :: mysql earlier than date 
Sql :: sqlite trim 
Sql :: select columns from 2 tables with foreign key 
Sql :: sql reverse 
Sql :: update database collation in postgresql 
Sql :: sql datetime functions 
Sql :: TSQL convert csv to table 
Sql :: ms sql select datetime as date 
Sql :: enable mysql query log 
Sql :: sql limit 
Sql :: sql download for windows 11 
Sql :: decode plsql 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =