示例#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);
        }
示例#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;
        }
示例#3
0
 private static string GetTableNameFrom(IFormatableTable table)
 {
     return "[" + table.Schema + "].[" + table.Name + "]";
 }