Esempio n. 1
0
        /// <summary>
        /// Formats a table name
        /// </summary>
        /// <param name="table">The table</param>
        /// <returns>SQL Fragment</returns>
        public string Format(IFormatableTable table)
        {
            if (table.Alias != null)
                return "[" + table.Alias + "]";

            return GetTableNameFrom(table);
        }
Esempio n. 2
0
        /// <summary>
        /// Formats a table name
        /// </summary>
        /// <param name="table">The table</param>
        /// <returns>SQL Fragment</returns>
        public string FormatForFromClause(IFormatableTable table)
        {
            string tableName = GetTableNameFrom(table);

            if (table.Alias != null)
                tableName += " AS [" + table.Alias + "]";

            return tableName;
        }
Esempio n. 3
0
 private static string GetTableNameFrom(IFormatableTable table)
 {
     return "[" + table.Schema + "].[" + table.Name + "]";
 }