Exemple #1
0
        public void ColumnsListTableAlias2()
        {
            SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql;

            ColumnsListSimple c = new ColumnsListSimple(SqlBuilder.DefaultFormatter);

            c.Append("a");
            c.SetTableAlias("t1");
            c.Append("b");
            c.SetTableAlias("t2");
            c.Append("c");
            c.SetTableAlias("");
            c.RawValue("(SELECT NOW())");
            c.Append("d");
            string result = c.GetSql();
            string sql    = "[a], [t1].[b], [t2].[c], (SELECT NOW()), [d]";

            Assert.AreEqual(sql, result);
        }
        public void ColumnsListTableAlias2()
        {
            SuperSql.DefaultFormatter = FormatterLibrary.MsSql;

            var c = new ColumnsListSimple(SuperSql.DefaultFormatter);

            c.Append("a");
            c.SetTableAlias("t1");
            c.Append("b");
            c.SetTableAlias("t2");
            c.Append("c");
            c.SetTableAlias();
            c.RawValue("(SELECT NOW())");
            c.Append("d");
            var result = c.GetSql();
            var sql    = "[a], [t1].[b], [t2].[c], (SELECT NOW()), [d]";

            Assert.Equal(sql, result);
        }