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