Skip to content

Commit 81ca323

Browse files
fix: sql server
1 parent ff22b0b commit 81ca323

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/BackupTablesService.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function backupTables($tablesToBackup)
4444

4545
protected function processBackup(array $tablesToBackup = [])
4646
{
47-
4847
$currentDateTime = now()->format('Y_m_d_H_i_s');
4948

5049
foreach ($tablesToBackup as $table) {
@@ -148,7 +147,7 @@ protected function backupTablesForForPostgres($newTableName, $table)
148147

149148
protected function backupTablesForForSqlServer($newTableName, $table)
150149
{
151-
DB::statement(/**@lang TSQL**/ "CREATE TABLE $newTableName AS SELECT * FROM $table");
150+
DB::statement("SELECT * INTO $newTableName FROM $table");
152151

153152
$newCreatedTables[] = $newTableName;
154153
$response[] = " Table '$table' cloned successfully.";

0 commit comments

Comments
 (0)