1.select name from sysobjects where xtype='U'
2.select name from syscolumns where id=object_id('tablename')
3.select * from tablename

解决方案 »

  1.   

    select d.name,a.name ,b.name ,a.length, a.isnullable from syscolumns a, systypes b,sysobjects d where a.xtype=b.xusertype and a.id=d.id and d.xtype='U'
      

  2.   

    1.获得表名:
    select name as 表名 from sysobjects where objectproperty(id,N'IsUserTable')=12.获得指定表的字段名:
    select name as 字段名 from syscolumns where id=object_id('表名') and objectproperty(id,N'IsUserTable')=13.用recordset.getstring 方法来获得表的数据内容.
      

  3.   

    1。如何在连接数据库成功后,得到数据库中用户表的名称,如:与数据库连接后自动将数据表的名称绑定在一个下拉框的列表中?select * from sysobjects where xtype='U'
    2。当选择一个用户表时,得到此用户表所有字段的名称?
    select A.name col from syscolumns A , sysobjects B where A.id=B.id and B.name='yourtable'
    3。使用SELECT查询用户表时,如何将查询结果显示在一个文本框中(也就是如何得到查询的结果)select * from yourtable