From ee60b30797483fdb87550031b2a37bcd43e1b665 Mon Sep 17 00:00:00 2001 From: Daniel Tullemans Date: Thu, 1 Nov 2018 14:39:37 -0500 Subject: [PATCH] Use bracket delimeters for database names * Allows unit tests to connect to Azure databases --- Database.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Database.cs b/Database.cs index 751fa27..64bfda4 100644 --- a/Database.cs +++ b/Database.cs @@ -108,8 +108,8 @@ public async Task RebuildAsync(Func modifyScript) await conn.ExecuteAsync($@" if db_id('{database}') is not null begin - alter database {database} set single_user with rollback immediate; - drop database {database}; + alter database [{database}] set single_user with rollback immediate; + drop database [{database}]; end" ); } @@ -128,7 +128,7 @@ public async Task BuildAsync(Func modifyScript) using (var conn = new SqlConnection(builder.ToString())) { - await conn.ExecuteAsync($"if db_id('{database}') is null create database {database}"); + await conn.ExecuteAsync($"if db_id('{database}') is null create database [{database}]"); } using (var conn = new SqlConnection(connectionString))