We have a JSON file with 10M records to bulk copy load into a SQL Server table. The Powershell code is below. The issue we are having is the first line seems to hang up, take a long time to execute and freeze the machine. Is there a more efficient way to convert a large JSON file into a data table?
$results = Get-Content $tempfile | ConvertFrom-Json
$dt2 = $results | select-object $FieldAttribute
$dataTable = ConvertTo-DataTable -InputObject $dt2