using System.Text; namespace Connected.Data.Schema.Sql { internal class TableRename : TableTransaction { public TableRename(string temporaryName) { TemporaryName = temporaryName; } private string TemporaryName { get; } protected override async Task OnExecute() { await Context.Execute(CommandText); } private string CommandText { get { var text = new StringBuilder(); text.AppendLine($"EXECUTE sp_rename N'{Unescape(Context.Schema.SchemaName())}.{Unescape(TemporaryName)}', N'{Unescape(Context.Schema.Name)}', 'OBJECT'"); return text.ToString(); } } } }