Hi, after 9 months, you have found a solution?, I wrote a little script but I am completely sure that is very ugly :D
DB::transaction(function() use ($dataKeys, $data) {
$table = 'table';
foreach ($data as $row) {
$rowWithKeys = array_combine($dataKeys, $row);
DB::insert("SET IDENTITY_INSERT " . $table . " ON;insert into " . $table . " ([column1], [column2], [column3]) values ('" . $rowWithKeys['column1'] . "', '" . $rowWithKeys['column2'] . "', '" . $rowWithKeys['column3'] . "');SET IDENTITY_INSERT " . $table . " OFF;");
}
});
DB::commit();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community