Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Loading json file into sql server
use TestDb go declare @cmd as nvarchar(max) declare @i int = 0; while @i < 3 begin set @cmd = 'insert into LogEntry SELECT le.* FROM OPENROWSET (BULK ''E:\json\data' + cast(@i as nvarchar) + '.json'', SINGLE_CLOB) as j CROSS APPLY OPENJSON(BulkColumn) WITH( Id int, [Data] nvarchar(MAX), Result nvarchar(MAX), Input nvarchar(MAX), Compiler_args nvarchar(2000), Lang int, Is_api int, [Time] datetime, Is_success int) AS le' Exec(@cmd) set @i = @i + 1 end
run
|
edit
|
history
|
help
0
1512081 QUAN LY DE TAI
aawrish
Dynamic Sql command with output variable
Query through an error in Sql Server 2008 r2
MERGE WITH OUTPUT
using lead() and sum() with over() in mssql
Find the database which have specify table name
CTE Recursive sample
test1
SI 1