Exemple #1
0
        public void BuildSelectFieldsTest()
        {
            string tableName = "userinfo";
            string sql       = _provider.BuildSelectFields(null, tableName);
            string expectSql = string.Format("SELECT tb_Column.Name,tb_Type.Name FROM SYSCOLUMNS  tb_Column , SYSTYPES tb_Type WHERE  tb_Column.ID=Object_Id('{0}') AND tb_Column.XTYPE=tb_Type.XUserTYPE", tableName);

            sql.ShouldBe(expectSql);
        }
        public void BuildSelectFieldsTest()
        {
            string tableName = "userinfo";
            string sql       = _provider.BuildSelectFields(null, tableName);
            string expectSql = string.Format("SELECT tb_col.name,tb_type.name FROM syscolumns as tb_col,systypes as tb_type WHERE tb_col.id = OBJECT_ID('{0}')  AND tb_col.usertype=tb_type.usertype", tableName);

            sql.ShouldBe(expectSql);
        }
        public void BuildSelectFieldsTest()
        {
            string dbName    = "userdb";
            string tableName = "userinfo";
            string sql       = _provider.BuildSelectFields(dbName, tableName);
            string expectSql = string.Format("SELECT `COLUMN_NAME`,`DATA_TYPE` FROM information_schema.`COLUMNS` WHERE `TABLE_SCHEMA`='{0}' and `TABLE_NAME`='{1}'", dbName, tableName);

            sql.ShouldBe(expectSql);
        }