Fix: RollbackService.cs
This commit is contained in:
@@ -18,15 +18,17 @@ namespace Services
|
||||
{
|
||||
using SqlConnection conn = sqlConnectionFactory.CreateSqlConnection();
|
||||
|
||||
string sql = "USE [master];\r\n" +
|
||||
"ALTER DATABASE [2025_5bhitn_konstantin_hintermayer_smarter_rentDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;\r\n" +
|
||||
"RESTORE DATABASE [2025_5bhitn_konstantin_hintermayer_smarter_rentDB] FROM DATABASE_SNAPSHOT = '2025_5bhitn_konstantin_hintermayer_smarter_rentDB_snapshot';\r\n" +
|
||||
"GO";
|
||||
string sql = @"
|
||||
USE [master];
|
||||
ALTER DATABASE [2025_5bhitn_konstantin_hintermayer_smarter_rentDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
RESTORE DATABASE [2025_5bhitn_konstantin_hintermayer_smarter_rentDB] FROM DATABASE_SNAPSHOT = '2025_5bhitn_konstantin_hintermayer_smarter_rentDB_snapshot';
|
||||
ALTER DATABASE [2025_5bhitn_konstantin_hintermayer_smarter_rentDB] SET MULTI_USER;";
|
||||
|
||||
using SqlCommand cmd = new SqlCommand(sql, conn);
|
||||
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user