CVE-2020-26207 (published 2020-11-04T22:15Z)

DatabaseSchemaViewer before version 2.7.4.3 is vulnerable to arbitrary code execution if a user is tricked into opening a specially crafted `.dbschema` file. The patch was released in v2.7.4.3. As a workaround, ensure `.dbschema` files from untrusted sources are not opened.

Severity: MEDIUM
CVSS v2 base score: 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 8.0, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-502
cwe_name: Deserialization of Untrusted Data
description: The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
extended_description: 
            It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security -- which is a dangerous security assumption.
            Data that is untrusted can not be trusted to be well-formed.
            When developers place no restrictions on "gadget chains," or series of instances and method invocations that can self-execute during the deserialization process (i.e., before the object is returned to the caller), it is sometimes possible for attackers to leverage them to perform unauthorized actions, like generating a shell.
         
         

Fix information:
repo_url: https://github.com/martinjw/dbschemareader
commit_details: repo_url: https://github.com/martinjw/dbschemareader
author: Martin Willey
author_date: 2020-09-03 18:00:28+02:00
msg: SqlGen - EscapeNames property to disable escaping
repository: repo_url: https://github.com/martinjw/dbschemareader
repo_name: martinjw/dbschemareader
description: Read database metadata (from SqlServer/Oracle/MySql/SQLite/PostgreSql/DB2 etc) into one simple model
repo_language: C#
owner: martinjw
file_changes: filename: DatabaseSchemaReader.sln
change_type: ModificationType.MODIFY
diff: @@ -1,7 +1,7 @@
 ﻿
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.4
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30225.117
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseSchemaReader", "DatabaseSchemaReader\DatabaseSchemaReader.csproj", "{8280AFB4-9066-4656-A80E-23B859E5299C}"
 EndProject
@@ -22,6 +22,8 @@ Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|x86 = Debug|x86
+		net35|Any CPU = net35|Any CPU
+		net35|x86 = net35|x86
 		Net4|Any CPU = Net4|Any CPU
 		Net4|x86 = Net4|x86
 		net45|Any CPU = net45|Any CPU
@@ -34,6 +36,10 @@ Global
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Debug|x86.Build.0 = Debug|Any CPU
+		{8280AFB4-9066-4656-A80E-23B859E5299C}.net35|Any CPU.ActiveCfg = Release|Any CPU
+		{8280AFB4-9066-4656-A80E-23B859E5299C}.net35|Any CPU.Build.0 = Release|Any CPU
+		{8280AFB4-9066-4656-A80E-23B859E5299C}.net35|x86.ActiveCfg = Release|Any CPU
+		{8280AFB4-9066-4656-A80E-23B859E5299C}.net35|x86.Build.0 = Release|Any CPU
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Net4|Any CPU.ActiveCfg = Release|Any CPU
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Net4|Any CPU.Build.0 = Release|Any CPU
 		{8280AFB4-9066-4656-A80E-23B859E5299C}.Net4|x86.ActiveCfg = Release|Any CPU
@@ -50,6 +56,10 @@ Global
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Debug|x86.Build.0 = Debug|Any CPU
+		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.net35|Any CPU.ActiveCfg = Release|Any CPU
+		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.net35|Any CPU.Build.0 = Release|Any CPU
+		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.net35|x86.ActiveCfg = Release|Any CPU
+		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.net35|x86.Build.0 = Release|Any CPU
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Net4|Any CPU.ActiveCfg = Release|Any CPU
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Net4|Any CPU.Build.0 = Release|Any CPU
 		{2881C1CA-88FC-4635-8B48-C0F1170C39B7}.Net4|x86.ActiveCfg = Release|Any CPU
@@ -66,6 +76,10 @@ Global
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Debug|x86.Build.0 = Debug|Any CPU
+		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.net35|Any CPU.ActiveCfg = net45|Any CPU
+		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.net35|Any CPU.Build.0 = net45|Any CPU
+		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.net35|x86.ActiveCfg = net45|Any CPU
+		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.net35|x86.Build.0 = net45|Any CPU
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Net4|Any CPU.ActiveCfg = net45|Any CPU
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Net4|Any CPU.Build.0 = net45|Any CPU
 		{7EF4F6B5-100C-432A-9858-C7F3FEC14F5C}.Net4|x86.ActiveCfg = net45|Any CPU
@@ -82,6 +96,10 @@ Global
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Debug|x86.Build.0 = Debug|Any CPU
+		{7BE356E2-11FD-4570-8523-EF512D476797}.net35|Any CPU.ActiveCfg = net35|Any CPU
+		{7BE356E2-11FD-4570-8523-EF512D476797}.net35|Any CPU.Build.0 = net35|Any CPU
+		{7BE356E2-11FD-4570-8523-EF512D476797}.net35|x86.ActiveCfg = net35|Any CPU
+		{7BE356E2-11FD-4570-8523-EF512D476797}.net35|x86.Build.0 = net35|Any CPU
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Net4|Any CPU.ActiveCfg = Net4|Any CPU
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Net4|Any CPU.Build.0 = Net4|Any CPU
 		{7BE356E2-11FD-4570-8523-EF512D476797}.Net4|x86.ActiveCfg = Net4|Any CPU
@@ -97,6 +115,10 @@ Global
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Debug|Any CPU.ActiveCfg = Debug|x86
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Debug|x86.ActiveCfg = Debug|x86
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Debug|x86.Build.0 = Debug|x86
+		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.net35|Any CPU.ActiveCfg = Release|x86
+		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.net35|Any CPU.Build.0 = Release|x86
+		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.net35|x86.ActiveCfg = net45|x86
+		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.net35|x86.Build.0 = net45|x86
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Net4|Any CPU.ActiveCfg = net45|x86
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Net4|Any CPU.Build.0 = net45|x86
 		{CE4A50D0-62F7-49A4-B216-7DEB7EA57147}.Net4|x86.ActiveCfg = net45|x86
@@ -111,4 +133,7 @@ Global
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {9D3E963B-CAE9-4937-86C7-E49C5DC2CDED}
+	EndGlobalSection
 EndGlobal

programming_language: C#
filename: InsertWriter.cs
change_type: ModificationType.MODIFY
diff: @@ -134,6 +134,11 @@ private void PrepareTypesDataTable()
         /// <value><c>true</c> if include blobs; otherwise, <c>false</c>.</value>
         public bool IncludeBlobs { get; set; }
 
+        /// <summary>
+        /// Escape table and column names (default true)
+        /// </summary>
+        public bool EscapeNames { get; set; } = true;
+
         /// <summary>
         /// Writes the INSERTs in the specified SQL dialect
         /// </summary>
@@ -267,7 +272,7 @@ private void PrepareTemplate()
         {
             var cols = GetAllColumns();
 
-            _template = "INSERT INTO " + _sqlWriter.EscapedTableName + @" (
+            _template = "INSERT INTO " + (EscapeNames ? _sqlWriter.EscapedTableName : _databaseTable.Name) + @" (
 " + FormattedColumns(cols) + @") VALUES (
 {0}
 );
@@ -288,7 +293,9 @@ private string[] GetAllColumns()
             {
                 if (IsNotWriteableType(databaseColumn)) continue;
                 if (!IncludeIdentity && databaseColumn.IsAutoNumber) continue;
-                cols.Add(_sqlWriter.EscapedColumnName(databaseColumn.Name));
+                var name = databaseColumn.Name;
+                if (EscapeNames) name = _sqlWriter.EscapedColumnName(databaseColumn.Name);
+                cols.Add(name);
             }
 
             return cols.ToArray();

programming_language: C#
filename: ScriptWriter.cs
change_type: ModificationType.MODIFY
diff: @@ -14,6 +14,11 @@ public class ScriptWriter
     {
         private int _pageSize = 1000;
 
+        /// <summary>
+        /// Escape table and column names (default true)
+        /// </summary>
+        public bool EscapeNames { get; set; } = true;
+
         /// <summary>
         /// Gets or sets the maximum number of records returned. Default is 1000.
         /// </summary>
@@ -85,6 +90,7 @@ public string ReadTable(DatabaseTable databaseTable, DbConnection connection)
             var w = new InsertWriter(databaseTable, dt);
             w.IncludeIdentity = IncludeIdentity;
             w.IncludeBlobs = IncludeBlobs;
+            w.EscapeNames = EscapeNames;
             var providerName = connection.GetType().Namespace;
             return w.Write(FindSqlType(providerName));
         }
@@ -129,6 +135,7 @@ public string ReadTable(DatabaseTable databaseTable, string connectionString, st
             var w = new InsertWriter(databaseTable, dt);
             w.IncludeIdentity = IncludeIdentity;
             w.IncludeBlobs = IncludeBlobs;
+            w.EscapeNames = EscapeNames;
             return w.Write(FindSqlType(providerName));
         }
 

programming_language: C#
filename: ConstraintWriterBase.cs
change_type: ModificationType.MODIFY
diff: @@ -14,13 +14,16 @@ abstract class ConstraintWriterBase
         protected ConstraintWriterBase(DatabaseTable table)
         {
             Table = table;
+            EscapeNames = true;
         }
 
         protected abstract ISqlFormatProvider SqlFormatProvider();
 
+        public bool EscapeNames { get; set; }
+
         protected string EscapeName(string name)
         {
-            return SqlFormatProvider().Escape(name);
+            return EscapeNames? SqlFormatProvider().Escape(name) : name;
         }
 
         public bool IncludeSchema { get; set; }
@@ -74,6 +77,7 @@ protected virtual string AddUniqueConstraintFormat
         {
             get { return "ALTER TABLE {0} ADD CONSTRAINT {1} UNIQUE ({2})"; }
         }
+
         private string WriteUniqueKey(DatabaseConstraint uniqueKey)
         {
             var columnList = GetColumnList(uniqueKey.Columns);

programming_language: C#
filename: TablesGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -50,7 +50,7 @@ protected override ISqlFormatProvider SqlFormatProvider()
 
         protected override void WriteDrops(StringBuilder sb)
         {
-            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider()));
+            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider(), EscapeNames));
         }
     }
 }

programming_language: C#
filename: DropTables.cs
change_type: ModificationType.MODIFY
diff: @@ -6,7 +6,7 @@ namespace DatabaseSchemaReader.SqlGen
 {
     class DropTables
     {
-        public static string Write(DatabaseSchema schema, ISqlFormatProvider formatter)
+        public static string Write(DatabaseSchema schema, ISqlFormatProvider formatter, bool escapeNames)
         {
             var sb = new StringBuilder();
             var lineEnding = formatter.LineEnding();
@@ -19,13 +19,13 @@ public static string Write(DatabaseSchema schema, ISqlFormatProvider formatter)
             {
                 foreach (var foreignKey in table.ForeignKeys)
                 {
-                    sb.AppendLine("-- ALTER TABLE " + formatter.Escape(table.Name) + " DROP CONSTRAINT " + foreignKey.Name + lineEnding);
-
+                    sb.AppendLine("-- ALTER TABLE " + (escapeNames ? formatter.Escape(table.Name) : table.Name) + 
+                                  " DROP CONSTRAINT " + foreignKey.Name + lineEnding);
                 }
             }
             foreach (var table in schema.Tables)
             {
-                sb.AppendLine("-- DROP TABLE " + formatter.Escape(table.Name) + lineEnding);
+                sb.AppendLine("-- DROP TABLE " + (escapeNames ? formatter.Escape(table.Name) : table.Name) + lineEnding);
             }
             return sb.ToString();
         }

programming_language: C#
filename: IMigrationGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -12,7 +12,11 @@ public interface IMigrationGenerator
         /// </summary>
         bool IncludeSchema { get; set; }
         /// <summary>
-        /// Adds the table. If any primary key, unqiue or check constraints are attached, they are written too (don't write them individually). Foreign keys must be added separately (use <see cref="AddConstraint"/>)
+        /// Escape the names (default true)
+        /// </summary>
+        bool EscapeNames { get; set; }
+        /// <summary>
+        /// Adds the table. If any primary key, unique or check constraints are attached, they are written too (don't write them individually). Foreign keys must be added separately (use <see cref="AddConstraint"/>)
         /// </summary>
         /// <param name="databaseTable">The database table.</param>
         /// <returns></returns>

programming_language: C#
filename: ITableGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -12,7 +12,10 @@ public interface ITableGenerator
         /// </summary>
         /// <value><c>true</c> if schema is written; otherwise, <c>false</c>.</value>
         bool IncludeSchema { get; set; }
-
+        /// <summary>
+        /// Escape the names (default true)
+        /// </summary>
+        bool EscapeNames { get; set; }
         /// <summary>
         /// Gets or sets a value indicating whether to include default values while writing column definitions
         /// </summary>
@@ -21,7 +24,6 @@ public interface ITableGenerator
         /// </value>
         bool IncludeDefaultValues { get; set; }
 
-
         /// <summary>
         /// Writes the DDL.
         /// </summary>

programming_language: C#
filename: ITablesGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -11,6 +11,11 @@ public interface ITablesGenerator
         /// <value><c>true</c> if schema is written; otherwise, <c>false</c>.</value>
         bool IncludeSchema { get; set; }
 
+        /// <summary>
+        /// Escape the table and column names
+        /// </summary>
+        bool EscapeNames { get; set; }
+
         /// <summary>
         /// Writes this ddl script.
         /// </summary>

programming_language: C#
filename: MigrationGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -4,7 +4,6 @@
 using System.Linq;
 using System.Text;
 using DatabaseSchemaReader.DataSchema;
-using DatabaseSchemaReader.SqlGen.SqLite;
 using DatabaseSchemaReader.Utilities;
 
 namespace DatabaseSchemaReader.SqlGen
@@ -19,6 +18,7 @@ public MigrationGenerator(SqlType sqlType)
             _sqlFormatProvider = SqlFormatFactory.Provider(sqlType);
             _ddlFactory = new DdlGeneratorFactory(sqlType);
             IncludeSchema = (sqlType != SqlType.SqlServerCe && sqlType != SqlType.SQLite);
+            EscapeNames = true;
         }
 
         /// <summary>
@@ -26,9 +26,16 @@ public MigrationGenerator(SqlType sqlType)
         /// </summary>
         public bool IncludeSchema { get; set; }
 
+        /// <summary>
+        /// Escape any names
+        /// </summary>
+        public bool EscapeNames { get; set; }
+
         protected virtual ITableGenerator CreateTableGenerator(DatabaseTable databaseTable)
         {
-            return _ddlFactory.TableGenerator(databaseTable);
+            var tableGenerator = _ddlFactory.TableGenerator(databaseTable);
+            if (!EscapeNames) tableGenerator.EscapeNames = false;
+            return tableGenerator;
         }
         protected virtual ISqlFormatProvider SqlFormatProvider()
         {
@@ -37,7 +44,7 @@ protected virtual ISqlFormatProvider SqlFormatProvider()
 
         public string Escape(string name)
         {
-            return SqlFormatProvider().Escape(name);
+            return EscapeNames ? SqlFormatProvider().Escape(name) : name;
         }
         protected virtual string LineEnding()
         {
@@ -214,6 +221,7 @@ public virtual string AddConstraint(DatabaseTable databaseTable, DatabaseConstra
             var constraintWriter = _ddlFactory.ConstraintWriter(databaseTable);
             if (constraintWriter == null) return null;
             constraintWriter.IncludeSchema = IncludeSchema; //cascade setting
+            constraintWriter.EscapeNames = EscapeNames;
             return constraintWriter.WriteConstraint(constraint);
         }
 

programming_language: C#
filename: TablesGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -29,7 +29,7 @@ protected override ISqlFormatProvider SqlFormatProvider()
 
         protected override void WriteDrops(StringBuilder sb)
         {
-            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider()));
+            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider(), EscapeNames));
         }
     }
 }

programming_language: C#
filename: TableGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -97,7 +97,7 @@ private static string TranslateCheckExpression(string expression)
         }
         protected virtual ConstraintWriterBase CreateConstraintWriter()
         {
-            return new ConstraintWriter(Table) { IncludeSchema = IncludeSchema };
+            return new ConstraintWriter(Table) { IncludeSchema = IncludeSchema, EscapeNames = EscapeNames};
         }
         protected virtual IMigrationGenerator CreateMigrationGenerator()
         {

programming_language: C#
filename: TablesGenerator.cs
change_type: ModificationType.MODIFY
diff: @@ -59,7 +59,7 @@ protected override ISqlFormatProvider SqlFormatProvider()
 
         protected override void WriteDrops(StringBuilder sb)
         {
-            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider()));
+            sb.AppendLine(DropTables.Write(Schema, SqlFormatProvider(), EscapeNames));
         }
     }
 }

programming_language: C#
filename: TableGeneratorBase.cs
change_type: ModificationType.MODIFY
diff: @@ -16,13 +16,19 @@ protected TableGeneratorBase(DatabaseTable table)
             TableName = table.Name;
             IncludeSchema = true;
             IncludeDefaultValues = true;
+            EscapeNames = true;
         }
 
         protected abstract ISqlFormatProvider SqlFormatProvider();
 
+        /// <summary>
+        /// Escape any names
+        /// </summary>
+        public bool EscapeNames { get; set; }
+
         private string EscapeName(string name)
         {
-            return SqlFormatProvider().Escape(name);
+            return EscapeNames? SqlFormatProvider().Escape(name) : name;
         }
         protected abstract string WriteDataType(DatabaseColumn column);
         protected abstract string NonNativeAutoIncrementWriter();

programming_language: C#
filename: TablesGeneratorBase.cs
change_type: ModificationType.MODIFY
diff: @@ -11,10 +11,13 @@ protected TablesGeneratorBase(DatabaseSchema schema)
         {
             Schema = schema;
             IncludeSchema = true;
+            EscapeNames = true;
         }
 
         public bool IncludeSchema { get; set; }
 
+        public bool EscapeNames { get; set; }
+
         public string Write()
         {
             var sb = new StringBuilder();
@@ -24,6 +27,7 @@ public string Write()
             {
                 var tableGenerator = LoadTableGenerator(table);
                 tableGenerator.IncludeSchema = IncludeSchema;
+                tableGenerator.EscapeNames = EscapeNames;
                 sb.AppendLine(tableGenerator.Write());
             }
             sb.AppendLine();
@@ -35,6 +39,7 @@ public string Write()
                 //SQLite has no ALTER TABLE support, so this is not supported
                 if (constraintWriter == null) continue;
                 constraintWriter.IncludeSchema = IncludeSchema;
+                constraintWriter.EscapeNames = EscapeNames;
                 sb.AppendLine(constraintWriter.WriteForeignKeys());
             }
             sb.AppendLine();

programming_language: C#
filename: SqlWriter.cs
change_type: ModificationType.MODIFY
diff: @@ -14,12 +14,13 @@ namespace DatabaseSchemaReader
     public class SqlWriter
     {
         private readonly DatabaseTable _table;
-        private readonly char _parameterPrefix;
-        private readonly string _nameEscapeStart;
-        private readonly string _nameEscapeEnd;
+        private char _parameterPrefix;
+        private string _nameEscapeStart;
+        private string _nameEscapeEnd;
         private IList<string> _primaryKeys;
         private readonly SqlType _sqlType;
         private bool _inStoredProcedure;
+        private bool _escapeNames;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="SqlWriter"/> class.
@@ -34,7 +35,13 @@ public SqlWriter(DatabaseTable table, SqlType sqlType)
             _sqlType = sqlType;
             _nameEscapeStart = null;
             _nameEscapeEnd = null;
-            switch (sqlType)
+            _escapeNames = true;
+            ParametersByType();
+        }
+
+        private void ParametersByType()
+        {
+            switch (_sqlType)
             {
                 case SqlType.MySql:
                     _parameterPrefix = '?'; //or @ but can conflict with variables
@@ -70,6 +77,25 @@ public SqlWriter(DatabaseTable table, SqlType sqlType)
             }
         }
 
+        /// <summary>
+        /// Escape the names (default true)
+        /// </summary>
+        public bool EscapeNames
+        {
+            get { return _escapeNames; }
+            set
+            {
+                _escapeNames = value;
+                if (value)
+                {
+                    ParametersByType(); //reset the start and end
+                }
+                else
+                {
+                    _nameEscapeStart = _nameEscapeEnd = string.Empty; //empty them out
+                }
+            }
+        }
 
         /// <summary>
         /// In stored procedures, Oracle and MySql do not use the parameter prefix. Ignored for SqlServer (which requires @).
@@ -709,7 +735,7 @@ private string FindIdentityParameter()
 
         private DatabaseColumn FindIdentityColumn()
         {
-            return _table.Columns.Find(delegate(DatabaseColumn col)
+            return _table.Columns.Find(delegate (DatabaseColumn col)
                     {
                         return col.IsAutoNumber;
                     });

programming_language: C#
filename: MigrationAddColumn.cs
change_type: ModificationType.MODIFY
diff: @@ -59,6 +59,25 @@ public void TestSqlServerNoSchema()
             Assert.IsTrue(sql.StartsWith("ALTER TABLE [Orders] ADD [COUNTRY] VARCHAR (20)", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
         }
 
+        [TestMethod]
+        public void TestSqlServerNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+            var column = CreateNewColumn();
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.AddColumn(table, column);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("ALTER TABLE Orders ADD COUNTRY VARCHAR (20)", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
+        }
 
         [TestMethod]
         public void TestOracleWithSchema()

programming_language: C#
filename: MigrationAddForeignKey.cs
change_type: ModificationType.MODIFY
diff: @@ -47,6 +47,25 @@ public void TestSqlServerNoSchema()
             Assert.IsTrue(sql.StartsWith("ALTER TABLE [Orders] ADD CONSTRAINT [FK_Orders] FOREIGN KEY ([Parent]) REFERENCES [Orders] ([Id])", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
         }
 
+        [TestMethod]
+        public void TestSqlServerNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+            var fk = MigrationCommon.CreateForeignKey(table);
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.AddConstraint(table, fk);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("ALTER TABLE Orders ADD CONSTRAINT FK_Orders FOREIGN KEY (Parent) REFERENCES Orders (Id)", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
+        }
 
         [TestMethod]
         public void TestOracleWithSchema()
@@ -86,6 +105,26 @@ public void TestOracleNoSchema()
             Assert.IsTrue(sql.StartsWith("ALTER TABLE \"Orders\" ADD CONSTRAINT \"FK_Orders\" FOREIGN KEY (\"Parent\") REFERENCES \"Orders\" (\"Id\")", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
         }
 
+        [TestMethod]
+        public void TestOracleNoSchemaNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.Oracle).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+            var fk = MigrationCommon.CreateForeignKey(table);
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.AddConstraint(table, fk);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("ALTER TABLE Orders ADD CONSTRAINT FK_Orders FOREIGN KEY (Parent) REFERENCES Orders (Id)", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
+        }
+
         [TestMethod]
         public void TestMySqlWithSchema()
         {

programming_language: C#
filename: MigrationAddIndex.cs
change_type: ModificationType.MODIFY
diff: @@ -107,6 +107,27 @@ public void TestSqlServerNoSchema()
             Assert.IsTrue(sql.StartsWith("CREATE UNIQUE INDEX [UI_COUNTRY] ON [Orders]([COUNTRY])", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
         }
 
+
+        [TestMethod]
+        public void TestSqlServerNoSchemaNoEscapeNames()
+        {
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+            var column = MigrationCommon.CreateNewColumn();
+            var index = MigrationCommon.CreateUniqueIndex(column, "COUNTRY");
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.AddIndex(table, index);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("CREATE UNIQUE INDEX UI_COUNTRY ON Orders(COUNTRY)", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
+        }
+
         [TestMethod]
         public void TestSqlServerNoSchema_NonClustered()
         {

programming_language: C#
filename: MigrationAddPrimaryKey.cs
change_type: ModificationType.MODIFY
diff: @@ -35,6 +35,33 @@ public void TestAddPrimaryKey()
             Assert.IsTrue(sql.IndexOf("ADD CONSTRAINT [Test_PK] PRIMARY KEY ([Id])", StringComparison.OrdinalIgnoreCase) != -1, "adding a primary key");
         }
 
+        [TestMethod]
+        public void TestAddPrimaryKeyNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var schema = new DatabaseSchema(null, SqlType.SqlServer);
+            var table = schema.AddTable("Test")
+                .AddColumn<int>("Id")
+                .AddColumn<string>("Name")
+                .Table;
+            var pk = new DatabaseConstraint
+            {
+                Name = "Test_PK",
+                ConstraintType = ConstraintType.PrimaryKey
+            };
+            pk.Columns.Add("Id");
+
+            //act
+            var sql = migration.AddConstraint(table, pk);
+
+            //assert
+            Assert.IsTrue(sql.IndexOf("ADD CONSTRAINT Test_PK PRIMARY KEY (Id)", StringComparison.OrdinalIgnoreCase) != -1, "adding a primary key");
+        }
+
         [TestMethod]
         public void TestAddPrimaryKeyWithGuid()
         {

programming_language: C#
filename: MigrationCreateTable.cs
change_type: ModificationType.MODIFY
diff: @@ -47,6 +47,25 @@ public void TestSqlServerCreateTableNoSchema()
             Assert.IsTrue(sql.Contains("ALTER TABLE [Orders] ADD CONSTRAINT [PK_Orders] PRIMARY KEY ([Id])"), "Primary key should be set with name");
         }
 
+        [TestMethod]
+        public void TestSqlServerCreateTableNoSchemaNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.AddTable(table);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("CREATE TABLE Orders", StringComparison.OrdinalIgnoreCase), "table name should be quoted correctly");
+            Assert.IsTrue(sql.Contains("ALTER TABLE Orders ADD CONSTRAINT PK_Orders PRIMARY KEY (Id)"), "Primary key should be set with name");
+        }
 
         [TestMethod]
         public void TestOracleCreateTableWithSchema()

programming_language: C#
filename: MigrationDropColumn.cs
change_type: ModificationType.MODIFY
diff: @@ -47,6 +47,25 @@ public void TestSqlServerNoSchema()
             Assert.IsTrue(sql.StartsWith("ALTER TABLE [Orders] DROP COLUMN [COUNTRY]", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
         }
 
+        [TestMethod]
+        public void TestSqlServerNoSchemaNoEscapeNames()
+        {
+
+            //arrange
+            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();
+            migration.EscapeNames = false;
+
+            var table = MigrationCommon.CreateTestTable("Orders");
+            table.SchemaOwner = "dbo";
+            var column = MigrationCommon.CreateNewColumn();
+
+            //act
+            migration.IncludeSchema = false;
+            var sql = migration.DropColumn(table, column);
+
+            //assert
+            Assert.IsTrue(sql.StartsWith("ALTER TABLE Orders DROP COLUMN COUNTRY", StringComparison.OrdinalIgnoreCase), "names should be quoted correctly");
+        }
 
         [TestMethod]
         public void TestOracleWithSchema()

programming_language: C#
filename: DatabaseSchemaViewer.csproj
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>DatabaseSchemaViewer</RootNamespace>
     <AssemblyName>DatabaseSchemaViewer</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <FileUpgradeFlags>
     </FileUpgradeFlags>
@@ -35,6 +35,7 @@
     <SccLocalPath>SAK</SccLocalPath>
     <SccAuxPath>SAK</SccAuxPath>
     <SccProvider>SAK</SccProvider>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -75,6 +76,22 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net35|AnyCPU'">
+     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <OutputPath>bin\net35\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup Condition="'$(Configuration)' != 'net35'">
+    <Reference Include="Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
+      <HintPath>..\packages\Oracle.ManagedDataAccess.19.8.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+  </ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
@@ -138,6 +155,7 @@
     <None Include="app.config">
       <SubType>Designer</SubType>
     </None>
+    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

programming_language: TypeScript
filename: Form1.Designer.cs
change_type: ModificationType.MODIFY
diff: @@ -36,6 +36,7 @@ private void InitializeComponent()
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.openSchema = new System.Windows.Forms.ToolStripButton();
             this.saveSchema = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
             this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
             this.label3 = new System.Windows.Forms.Label();
@@ -51,8 +52,9 @@ private void InitializeComponent()
             this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
             this.treeContext = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+            this.tsbQuote = new System.Windows.Forms.ToolStripButton();
             this.statusStrip1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
             this.splitContainer1.Panel1.SuspendLayout();
             this.splitContainer1.Panel2.SuspendLayout();
             this.splitContainer1.SuspendLayout();
@@ -109,7 +111,8 @@ private void InitializeComponent()
             this.saveSchema,
             this.toolStripSeparator1,
             this.toolStripButton1,
-            this.toolStripButton2});
+            this.toolStripButton2,
+            this.tsbQuote});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(625, 25);
@@ -139,6 +142,11 @@ private void InitializeComponent()
             this.saveSchema.ToolTipText = "Save Schema";
             this.saveSchema.Click += new System.EventHandler(this.SaveSchemaClick);
             // 
+            // toolStripSeparator1
+            // 
+            this.toolStripSeparator1.Name = "toolStripSeparator1";
+            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+            // 
             // toolStripButton1
             // 
             this.toolStripButton1.Enabled = false;
@@ -269,10 +277,18 @@ private void InitializeComponent()
             this.treeContext.Name = "treeContext";
             this.treeContext.Size = new System.Drawing.Size(61, 4);
             // 
-            // toolStripSeparator1
+            // tsbQuote
             // 
-            this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+            this.tsbQuote.Checked = true;
+            this.tsbQuote.CheckOnClick = true;
+            this.tsbQuote.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.tsbQuote.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+            this.tsbQuote.Image = ((System.Drawing.Image)(resources.GetObject("tsbQuote.Image")));
+            this.tsbQuote.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.tsbQuote.Name = "tsbQuote";
+            this.tsbQuote.Size = new System.Drawing.Size(87, 22);
+            this.tsbQuote.Text = "Escape Names";
+            this.tsbQuote.Click += new System.EventHandler(this.tsbQuote_Click);
             // 
             // Form1
             // 
@@ -290,6 +306,7 @@ private void InitializeComponent()
             this.splitContainer1.Panel1.ResumeLayout(false);
             this.splitContainer1.Panel1.PerformLayout();
             this.splitContainer1.Panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
             this.splitContainer1.ResumeLayout(false);
             this.toolStrip1.ResumeLayout(false);
             this.toolStrip1.PerformLayout();
@@ -323,6 +340,7 @@ private void InitializeComponent()
         private System.Windows.Forms.ToolStripButton openSchema;
         private System.Windows.Forms.ToolStripButton saveSchema;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        private System.Windows.Forms.ToolStripButton tsbQuote;
     }
 }
 

programming_language: C#
filename: Form1.cs
change_type: ModificationType.MODIFY
diff: @@ -325,10 +325,10 @@ private void TreeMouseUp(object sender, MouseEventArgs e)
             if (schema != null)
             {
                 var create = new ToolStripMenuItem("CREATE TABLEs to clipboard");
-                create.Click += (s, ea) => new SqlTasks(sqlType).BuildAllTableDdl(schema);
+                create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAllTableDdl(schema);
                 menu.Items.Add(create);
                 var deletes = new ToolStripMenuItem("DELETE all table data (in logical order) to clipboard");
-                deletes.Click += (s, ea) => new SqlTasks(sqlType).DeleteAllData(schema);
+                deletes.Click += (s, ea) => BuildSqlTasks(sqlType).DeleteAllData(schema);
                 menu.Items.Add(deletes);
             }
             else if (view != null)
@@ -343,13 +343,13 @@ private void TreeMouseUp(object sender, MouseEventArgs e)
             else if (pack != null)
             {
                 var create = new ToolStripMenuItem("CREATE PACKAGE " + pack.Name + " to clipboard");
-                create.Click += (s, ea) => new SqlTasks(sqlType).BuildPackage(pack);
+                create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildPackage(pack);
                 menu.Items.Add(create);
             }
             else if (fun != null)
             {
                 var create = new ToolStripMenuItem("CREATE FUNCTION " + fun.Name + " to clipboard");
-                create.Click += (s, ea) => new SqlTasks(sqlType).BuildFunction(fun);
+                create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildFunction(fun);
                 menu.Items.Add(create);
             }
             else if (sproc != null)
@@ -357,7 +357,7 @@ private void TreeMouseUp(object sender, MouseEventArgs e)
                 if (!string.IsNullOrEmpty(sproc.Sql))
                 {
                     var create = new ToolStripMenuItem("CREATE STORED PROC " + sproc.Name + " to clipboard");
-                    create.Click += (s, ea) => new SqlTasks(sqlType).BuildProcedure(sproc);
+                    create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildProcedure(sproc);
                     menu.Items.Add(create);
 
                     var bar = new ToolStripSeparator();
@@ -365,47 +365,47 @@ private void TreeMouseUp(object sender, MouseEventArgs e)
                 }
 
                 var code = new ToolStripMenuItem("C# class to clipboard");
-                code.Click += (s, ea) => new SqlTasks(sqlType).BuildProcedureCode(_databaseSchema, sproc);
+                code.Click += (s, ea) => BuildSqlTasks(sqlType).BuildProcedureCode(_databaseSchema, sproc);
                 menu.Items.Add(code);
 
             }
             else if (column != null)
             {
                 var add = new ToolStripMenuItem("ADD COLUMN " + column.Name + " to clipboard");
-                add.Click += (s, ea) => new SqlTasks(sqlType).BuildAddColumn(column);
+                add.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAddColumn(column);
                 menu.Items.Add(add);
                 var alter = new ToolStripMenuItem("ALTER COLUMN " + column.Name + " to clipboard");
-                alter.Click += (s, ea) => new SqlTasks(sqlType).BuildAlterColumn(column);
+                alter.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAlterColumn(column);
                 menu.Items.Add(alter);
             }
             else if (constraint != null)
             {
                 var parentTable = node.Parent.Parent.Tag as DatabaseTable;
                 var add = new ToolStripMenuItem("ADD CONSTRAINT " + constraint.Name + " to clipboard");
-                add.Click += (s, ea) => new SqlTasks(sqlType).BuildAddConstraint(parentTable, constraint);
+                add.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAddConstraint(parentTable, constraint);
                 menu.Items.Add(add);
                 var drop = new ToolStripMenuItem("DROP CONSTRAINT " + constraint.Name + " to clipboard");
-                drop.Click += (s, ea) => new SqlTasks(sqlType).BuildDropConstraint(parentTable, constraint);
+                drop.Click += (s, ea) => BuildSqlTasks(sqlType).BuildDropConstraint(parentTable, constraint);
                 menu.Items.Add(drop);
             }
             else if (trigger != null)
             {
                 var parentTable = node.Parent.Parent.Tag as DatabaseTable;
                 var add = new ToolStripMenuItem("ADD TRIGGER " + trigger.Name + " to clipboard");
-                add.Click += (s, ea) => new SqlTasks(sqlType).BuildAddTrigger(parentTable, trigger);
+                add.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAddTrigger(parentTable, trigger);
                 menu.Items.Add(add);
                 var drop = new ToolStripMenuItem("DROP TRIGGER " + trigger.Name + " to clipboard");
-                drop.Click += (s, ea) => new SqlTasks(sqlType).BuildDropTrigger(trigger);
+                drop.Click += (s, ea) => BuildSqlTasks(sqlType).BuildDropTrigger(trigger);
                 menu.Items.Add(drop);
             }
             else if (index != null)
             {
                 var parentTable = node.Parent.Parent.Tag as DatabaseTable;
                 var add = new ToolStripMenuItem("ADD INDEX " + index.Name + " to clipboard");
-                add.Click += (s, ea) => new SqlTasks(sqlType).BuildAddIndex(parentTable, index);
+                add.Click += (s, ea) => BuildSqlTasks(sqlType).BuildAddIndex(parentTable, index);
                 menu.Items.Add(add);
                 var drop = new ToolStripMenuItem("DROP INDEX " + index.Name + " to clipboard");
-                drop.Click += (s, ea) => new SqlTasks(sqlType).BuildDropIndex(parentTable, index);
+                drop.Click += (s, ea) => BuildSqlTasks(sqlType).BuildDropIndex(parentTable, index);
                 menu.Items.Add(drop);
             }
 
@@ -417,12 +417,17 @@ private void TreeMouseUp(object sender, MouseEventArgs e)
 
         }
 
+        private SqlTasks BuildSqlTasks(SqlType sqlType)
+        {
+            return new SqlTasks(sqlType, tsbQuote.Checked);
+        }
+
         private void BuildViewMenu(ToolStrip menu, DatabaseView view, SqlType sqlType)
         {
             if (!string.IsNullOrEmpty(view.Sql))
             {
                 var create = new ToolStripMenuItem("CREATE VIEW " + view.Name + " to clipboard");
-                create.Click += (s, ea) => new SqlTasks(sqlType).BuildView(view);
+                create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildView(view);
                 menu.Items.Add(create);
 
                 var bar = new ToolStripSeparator();
@@ -430,11 +435,11 @@ private void BuildViewMenu(ToolStrip menu, DatabaseView view, SqlType sqlType)
             }
 
             var select = new ToolStripMenuItem("SELECT VIEW to clipboard");
-            select.Click += (s, ea) => new SqlTasks(sqlType).BuildTableSelect(view);
+            select.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableSelect(view);
             menu.Items.Add(select);
 
             var selectPaged = new ToolStripMenuItem("SELECT VIEW PAGED to clipboard");
-            selectPaged.Click += (s, ea) => new SqlTasks(sqlType).BuildTableSelectPaged(view);
+            selectPaged.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableSelectPaged(view);
             menu.Items.Add(selectPaged);
         }
 
@@ -442,41 +447,41 @@ private void BuildTableMenu(ToolStrip menu, DatabaseTable table, SqlType sqlType
         {
             if (menu == null) throw new ArgumentNullException("menu");
             var create = new ToolStripMenuItem("CREATE TABLE " + table.Name + " to clipboard");
-            create.Click += (s, ea) => new SqlTasks(sqlType).BuildTableDdl(table);
+            create.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableDdl(table);
             menu.Items.Add(create);
 
             var drop = new ToolStripMenuItem("DROP TABLE " + table.Name + " to clipboard");
-            drop.Click += (s, ea) => new SqlTasks(sqlType).BuildDropTable(table);
+            drop.Click += (s, ea) => BuildSqlTasks(sqlType).BuildDropTable(table);
             menu.Items.Add(drop);
 
             var bar = new ToolStripSeparator();
             menu.Items.Add(bar);
 
             var select = new ToolStripMenuItem("SELECT TABLE to clipboard");
-            select.Click += (s, ea) => new SqlTasks(sqlType).BuildTableSelect(table);
+            select.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableSelect(table);
             menu.Items.Add(select);
 
             var selectPaged = new ToolStripMenuItem("SELECT TABLE PAGED to clipboard");
-            selectPaged.Click += (s, ea) => new SqlTasks(sqlType).BuildTableSelectPaged(table);
+            selectPaged.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableSelectPaged(table);
             menu.Items.Add(selectPaged);
 
             var insert = new ToolStripMenuItem("INSERT TABLE to clipboard");
-            insert.Click += (s, ea) => new SqlTasks(sqlType).BuildTableInsert(table);
+            insert.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableInsert(table);
             menu.Items.Add(insert);
 
             var update = new ToolStripMenuItem("UPDATE TABLE to clipboard");
-            update.Click += (s, ea) => new SqlTasks(sqlType).BuildTableUpdate(table);
+            update.Click += (s, ea) => BuildSqlTasks(sqlType).BuildTableUpdate(table);
             menu.Items.Add(update);
 
             var bar2 = new ToolStripSeparator();
             menu.Items.Add(bar2);
 
             var code = new ToolStripMenuItem("C# class to clipboard");
-            code.Click += (s, ea) => new SqlTasks(sqlType).BuildClass(table);
+            code.Click += (s, ea) => BuildSqlTasks(sqlType).BuildClass(table);
             menu.Items.Add(code);
 
             var data = new ToolStripMenuItem("INSERT (first 100 rows) to clipboard");
-            data.Click += (s, ea) => new SqlTasks(sqlType).GetData(table, ConnectionString.Text.Trim(), (string)DataProviders.SelectedItem);
+            data.Click += (s, ea) => BuildSqlTasks(sqlType).GetData(table, ConnectionString.Text.Trim(), (string)DataProviders.SelectedItem);
             menu.Items.Add(data);
         }
 
@@ -545,5 +550,9 @@ private void OpenSchemaClick(object sender, EventArgs e)
             }
         }
 
+        private void tsbQuote_Click(object sender, EventArgs e)
+        {
+            tsbQuote.ForeColor = tsbQuote.Checked ? SystemColors.ControlText : SystemColors.InactiveCaption;
+        }
     }
 }

programming_language: C#
filename: Form1.resx
change_type: ModificationType.MODIFY
diff: @@ -112,100 +112,115 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>402, 17</value>
   </metadata>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="openSchema.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJ0SURBVDhPvZNJSBRgGIbn0KFLFpmRBEmWiAWDgSHVIcSK
-        cqVcQcmFyo0yQzHHpRm3UWdxnVLRZkZt1NHKUgwrhEKRCC0XSkzNgqJSTA2V3J7GEYam7OClH97Lz/c+
-        3/v9i0DwP1ZWSbWrpFDH9VwtUpWeZJkmZUN9Q+NV+EQpgldNl5MqrdINsIRMtV9IfAmCxpr8AIP4U611
-        UsW/ukSJSj19YxR4RxUYAQz1aZifajDq56SOxXE1eq2CppqM9PUgPtFKvCML8YgoRtBQpWRustbMvPyl
-        lMWBOGpv51Jdlo26JJ3ygjRuyUUU5yRiBq3TyJj7pjF1XjGYGRLBQMS6+gtwpyKHH5/LjbFXzW2NMqMe
-        6fNo1uVwvzobvToDXbkEreoGlYUplClFqGRJa2mqy7OZ+VDEauzRDjFNtUqWRyUwlmmu94a9kWQYjIc3
-        MfTW+xMb5lUlUKsymB7OhY9yHtQp6HosXyv6fYTXIdDty1KnO/NPXHhXJST6/Mnpqxc8DwoqCsV8fyth
-        rDOVJp2clREx9EeuAXrDDcZAlrq8mG8/xUzrMSYaDyGJsiPQ1bLAeJilylQm+pK4WyOj57khyWCcAXAR
-        eoJZeXGWhWdnmG07zmSTE1/rHOjO2kaQuy1O9lvsjQBVnoj+9jTu1eTBcBq8MsR96cdChwezT12YanZm
-        XC/kk2Y/A3JLxBH7cDxg3WK6yiJpIg3aXAYeRtOdLzCpS76J9pzNtKRvpT7FCnXibm5esyHIbe+Ks6ON
-        mwmQn5lAvvgS0qRQkq8EEBvuRZj/Cc6dPoLrUSGHhXY42O5mj/UOdm63YJelhflD2tCvWqf4F+fW5Qkp
-        G1zGAAAAAElFTkSuQmCC
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJ0SURBVDhPvZJZSNRRHEb/Dz30kkVmJEKSJWKBGBhSPYQo
+        Ua6UKyi5UOkoZYZijksz7jqL65SKNuPSqKPVlGJYIRSKRGi5UGJqFhSVYmqo5HYaR5EsH4KgDz643HvP
+        4cflCv8lGcXVztICLddyKslS6UiUaZLWjv4uIbEqvEWKoJX1pYQKs1SDLC5d7RscW4zQWJPnbyi/t6Uu
+        S2GkN4lIXOLhE6XAS5RvFDDYq2FussHYHxNaFsbU6CoV6GvSUteYDfGOVOIVUYB7eBFCQ5WS2YnaDfDS
+        5xIW+mOovZVDdWkm6uJUyvJTuCkXU5Qdz5pnNXUaGbNfNevwsgFmUAz94Zv2D8Ht8my+fypbh1sbZcY+
+        1OXSpM3mXnUmOnUa2jIplarrVBQkUaoUo5IlrMqqyzKZfl9oHHukXYK+VsnSiBRG0zf2nWFvOBEGYuF1
+        FD31fkSHelYJalUaU0M58EHO/ToFnY/kq5d+Hf1VMHT5sNjhxtxjJ95W2SE65zJ15bzHIaG8QMK3N1JG
+        O5LRa+UsD0ugL2IV7AkzgAEsdnoy13aS6ZbjjDceRiqyJsDZNN/4BiXKZMZ7E7hTI6P7mWGSgRiD4AJ0
+        B7H8/AzzT08z03qCCb0DX+ps6crYQaCbFQ4222yMAlWumL62FO7W5MJQCrw0jPvCl/l2d2aeODHZ5MiY
+        zo6PmgP0y02RhO/H/qB5sxFeSWFWPA2VOfQ/iKQrT1hvp3wLbdlbaU7dTn2SGep4C25ctSTQdd+yo72l
+        6xouCHnpceRJLpKVEELiZX+iwzwJ9XPh7KmjOB+z44idNbZWFuw138XunSbsMTXZ+A/+LYLwE+S85Qd1
+        BNSrAAAAAElFTkSuQmCC
 </value>
   </data>
   <data name="saveSchema.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAItSURBVDhPrZPdS5NxFMf9F7zvJvCi25oaw7VYDZ5yDmXZ
-        MKyIUp/wNU2X+UKKpWnU8gWyFS6dtFpNwklFvoApYiKLpWhl5oqmOHxFJ4LBt9/5Rc8v07rJH5zLz+c8
-        55zvExa2E+/F8xCoPO0raHMv45FzAS3NQdyzzaCh/hust/y4XjWJ8rKPKC4aQ0H+CC7k+KD0JrCnG6iv
-        W8e/3tr6BgxJPTiR9IyXInA/XeKCmurFv/IEBxfWcND0EiqVDPNxlxA4H85zQXnZ9LaCX/DnwBIijR4U
-        XZ7CMVOrENibZrngkuXTFsHv8LuJIPZIbuTljiMh3i4EjXcCXJCdNbJJ8Cc84Atgl84JWR6G0WgTgrra
-        r1wgpw0rgu3g7qEvCI9pxslTrxEb2yAEN2qm0NUJdkrgzLk3MJ/u59umhdHM9NnU+Sfci0TzK0iSVQiu
-        VkygwwOWAaDV8Z3dfRVVlXN8qbQwmjkzw6fAcQnt0OurhaCkeByux8AD+wYLTgiG5NxNZTprQXJ6Ke8c
-        F8/goy7odBVCYCkYZTBQezvEO5OAhQSRGgneD7MYnZyDnH8Nhw1tHNYcckCrLRUCiqXtLpTPJgHB5wtv
-        4r1/Hv6ZZVy8YkWUzsHgFkQduA9NTKEQZGa8ZXOv8Jkj9C7s3ifhSUcfPJ0D6OodQv+gF0eMZqi0TYhm
-        8F51I9TqPCHISvcmpqb08XhSwigkdGc6FW2bFkYzU1cqgvdHZwvB//zRPwBCVjq+3Cul5wAAAABJRU5E
-        rkJggg==
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIzSURBVDhPrZLrS9NRGMd//0LvexP0orc1NYZrsRr8yjWU
+        ZcOwIrr9wltpuswLKZamUcsLZCtcOmm1moSTiryAKWIii6VoZeaKpji8ohPB4Nt5zn55sqIX0QPPm8P5
+        fM55LtJ/iefPIqD0tS6hxbuIh+45NDWGcdcxhbrar7DfDOJaxThKSz6gsGAEeblDOH8uABWXJAK7OoHa
+        mlX8LVZW12BK6cLhlKc8VVySvE8WuKCqcl69+nsQHJ5bwW7LC2g0CqyHPELgfjDLBaUlk+r1jfED/hRa
+        QIzZh4JLEzhoaRYCZ8M0F1y0fVQRET/Db8fC2CZ7kZM9iqREpxDU3w5xQVbmkIpF41e4LxDCZoMbijII
+        s9khBDXVX7hAOTOoon+GOwc+Y1N8I44cfYWEhDohuF41gY52sFECx0++hvVYL+82NYxqpm/Ty1G4G8nW
+        l5BluxBcKRtDmw9sB4Bm1zc292VUlM/wplLDqOaM9MA6fCCpFUZjpRAUFY7C8wi471xjixOBKTV7Q1pO
+        2JCaVhyFExm83wODoUwIbHnDDAaqb0X4ywSxY8ToZPjfT2N4fAZK7lXsNbVwWLfHBb2+WAhoLR13sP5t
+        EhB8Nv8G3gVnEZxaxIXLdsQaXAxuQuyue9DF5wtBRvobVvcSh7caPdiyQ8bjth742vvQ0T2A3n4/9pmt
+        0OgbEMfg7dp6aLU5QpCZ5k8+faqHrydtGC0JzZlGRd2mhlHN9ColwTvjsoTg30OSvgNCVjq+glI0hgAA
+        AABJRU5ErkJggg==
 </value>
   </data>
   <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         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
-        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
+        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
 </value>
   </data>
   <data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         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
-        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
+        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
         gg==
 </value>
   </data>
-  <metadata name="connectionContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <data name="tsbQuote.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <metadata name="connectionContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>501, 17</value>
   </metadata>
-  <metadata name="errorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="errorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>127, 17</value>
   </metadata>
-  <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>250, 17</value>
   </metadata>
-  <metadata name="treeContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="treeContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>655, 17</value>
   </metadata>
 </root>
\ No newline at end of file

programming_language: Markdown
filename: Resources.Designer.cs
change_type: ModificationType.MODIFY
diff: @@ -1,7 +1,7 @@
 ﻿//------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.1
+//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -19,7 +19,7 @@ namespace DatabaseSchemaViewer.Properties {
     // class via a tool like ResGen or Visual Studio.
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     internal class Resources {

programming_language: C#
filename: Settings.Designer.cs
change_type: ModificationType.MODIFY
diff: @@ -1,7 +1,7 @@
 ﻿//------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.34011
+//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -12,7 +12,7 @@ namespace DatabaseSchemaViewer.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

programming_language: C#
filename: SqlTasks.cs
change_type: ModificationType.MODIFY
diff: @@ -21,16 +21,20 @@ class SqlTasks
         private readonly IMigrationGenerator _migrationGenerator;
         private readonly SqlType _sqlType;
 
-        public SqlTasks(SqlType sqlType)
+        public SqlTasks(SqlType sqlType, bool escapeNames)
         {
             _sqlType = sqlType;
             _migrationGenerator = new DdlGeneratorFactory(sqlType).MigrationGenerator();
+            EscapeNames = _migrationGenerator.EscapeNames = escapeNames;
         }
 
+        public bool EscapeNames { get; set; }
+
         public void BuildAllTableDdl(DatabaseSchema databaseSchema)
         {
             var tg = new DdlGeneratorFactory(_sqlType).AllTablesGenerator(databaseSchema);
             tg.IncludeSchema = false;
+            tg.EscapeNames = EscapeNames;
             try
             {
                 var txt = tg.Write();
@@ -56,7 +60,7 @@ public void DeleteAllData(DatabaseSchema databaseSchema)
                         sb.AppendLine("-- WARNING: " + databaseTable.Name + " has SELF-JOIN");
                     }
                     var sqlWriter = new SqlWriter(databaseTable, _sqlType);
-                    sb.AppendLine("DELETE FROM " + sqlWriter.EscapedTableName);
+                    sb.AppendLine("DELETE FROM " + (EscapeNames ? sqlWriter.EscapedTableName : databaseTable.Name));
                 }
                 Clipboard.SetText(sb.ToString(), TextDataFormat.UnicodeText);
             }
@@ -74,6 +78,7 @@ public void GetData(DatabaseTable databaseTable, string connectionString, string
                 sw.IncludeBlobs = false;
                 sw.IncludeIdentity = true;
                 sw.PageSize = 100;
+                sw.EscapeNames = EscapeNames;
                 var txt = sw.ReadTable(databaseTable, connectionString, providerName);
                 Clipboard.SetText(txt, TextDataFormat.UnicodeText);
             }
@@ -87,6 +92,7 @@ public void BuildTableDdl(DatabaseTable databaseTable)
         {
             var tg = new DdlGeneratorFactory(_sqlType).TableGenerator(databaseTable);
             tg.IncludeSchema = false;
+            tg.EscapeNames = EscapeNames;
             try
             {
                 var txt = tg.Write();
@@ -111,9 +117,16 @@ public void BuildDropTable(DatabaseTable table)
             }
         }
 
-        public void BuildTableSelect(DatabaseTable databaseTable)
+        private SqlWriter BuildSqlWriter(DatabaseTable databaseTable)
         {
             var sqlWriter = new SqlWriter(databaseTable, _sqlType);
+            sqlWriter.EscapeNames = EscapeNames;
+            return sqlWriter;
+        }
+
+        public void BuildTableSelect(DatabaseTable databaseTable)
+        {
+            var sqlWriter = BuildSqlWriter(databaseTable);
             try
             {
                 var txt = sqlWriter.SelectAllSql();
@@ -124,9 +137,11 @@ public void BuildTableSelect(DatabaseTable databaseTable)
                 Debug.WriteLine(exception.Message);
             }
         }
+
+
         public void BuildTableSelectPaged(DatabaseTable databaseTable)
         {
-            var sqlWriter = new SqlWriter(databaseTable, _sqlType);
+            var sqlWriter = BuildSqlWriter(databaseTable);
             try
             {
                 var txt = sqlWriter.SelectPageSql();
@@ -139,7 +154,7 @@ public void BuildTableSelectPaged(DatabaseTable databaseTable)
         }
         public void BuildTableInsert(DatabaseTable databaseTable)
         {
-            var sqlWriter = new SqlWriter(databaseTable, _sqlType);
+            var sqlWriter = BuildSqlWriter(databaseTable);
             try
             {
                 var txt = sqlWriter.InsertSqlWithoutOutputParameter();
@@ -152,7 +167,7 @@ public void BuildTableInsert(DatabaseTable databaseTable)
         }
         public void BuildTableUpdate(DatabaseTable databaseTable)
         {
-            var sqlWriter = new SqlWriter(databaseTable, _sqlType);
+            var sqlWriter = BuildSqlWriter(databaseTable);
             try
             {
                 var txt = sqlWriter.UpdateSql();

programming_language: C#
filename: app.config
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,13 @@
-﻿<?xml version="1.0" encoding="utf-8" ?>
+﻿<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <configSections>
-    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
-      <section name="DatabaseSchemaViewer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+      <section name="DatabaseSchemaViewer.Properties.Settings"
+        type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
+        allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
     </sectionGroup>
+    <section name="oracle.manageddataaccess.client"
+      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
   </configSections>
   <userSettings>
     <DatabaseSchemaViewer.Properties.Settings>
@@ -63,6 +67,9 @@
       <add name="Npgsql Data Provider" invariant="Npgsql"
            description=".Net Framework Data Provider for Postgresql Server"
          type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.11.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"/>-->
+      <remove invariant="Oracle.ManagedDataAccess.Client"/>
+      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
+        type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
     </DbProviderFactories>
   </system.data>
   <!-- VisualStudio 2008- remove this to run -->
@@ -70,4 +77,13 @@
     <supportedRuntime version="v4.0"/>
     <supportedRuntime version="v2.0.50727"/>
   </startup>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <publisherPolicy apply="no"/>
+        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
+        <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
 </configuration>
\ No newline at end of file

programming_language: C#
filename: packages.config
change_type: ModificationType.ADD
diff: @@ -0,0 +1,4 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Oracle.ManagedDataAccess" version="19.8.0" targetFramework="net40" />
+</packages>
\ No newline at end of file

programming_language: Scala
filename: build.proj
change_type: ModificationType.MODIFY
diff: @@ -20,7 +20,7 @@
     <Message Text="Building SchemaViewer in .net 3.5" />
     <RemoveDir Directories="$(OutputPath)net35\"/>
     <MSBuild Projects="DatabaseSchemaViewer\DatabaseSchemaViewer.csproj" 
-		Properties="Configuration=Release;OutputPath=$(OutputPath)net35\;IntermediateOutputPath=$(ObjPath)Release\"/>
+		Properties="Configuration=net35;OutputPath=$(OutputPath)net35\;IntermediateOutputPath=$(ObjPath)Release\"/>
     <Message Text="SchemaViewer Built" />
 	<Copy SourceFiles="DatabaseSchemaReader\README.txt" DestinationFolder="$(OutputPath)" />
   </Target>

programming_language: PowerShell