SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='Account' SELECT (case when a.colorder=1 then d.name else '' end) as 表名,--如果表名相同就返回空 a.colorder as 字段序号, a.name as 字段名, (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' e
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='subject' --表名 1.利用sysobjects系统表 在这个表中,在数据库中创建的每个对象(例如约束.默认值.日志.规则以及存储过程)都有对应一行,我们在该表中筛选出xtype等于U的所有记录,就为数据库中的表了. 示例语句如下: select * from sysobjects where xtype='U' 注意:在SQL SERVER2005中,出现了sys.ob
查询数据库中所有表名select table_name from information_schema.tables where table_schema='csdb' and table_type='base table'; 查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='csdb' and table_name='users'
SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='Account' SELECT (case when a.colorder=1 then d.name else '' end) as 表名,--如果表名相同就返回空 a.colorder as 字段序号, a.name as 字段名, (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity'
查询数据库里所有表名和字段名的语句SQL 查询所有表名:SELECT NAME FROM SYSOBJECTS WHERE TYPE='U'SELECT * FROM INFORMATION_SCHEMA.TABLES查询表的所有字段名:SELECT NAME FROM SYSCOLUMNS WHERE ID=OBJECT_ID(' 表名' )SELECT * FROM INFORMATION_SCHEMA.TABLESSELECT * FROM INFORMATION_SCHEMA.VIEWS
查询数据库中所有表名select table_name from information_schema.tables where table_schema='数据库名' and table_type='base table';查询指定数据库中指定表的所有字段名column_nameselect column_name from information_schema.columns where table_schema='数据库名' and table_name='表名'; #查看分布式系统中不同
查询数据库的锁表情况语句如下: SELECT p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name FROM v$process p,v$session a, v$locked_object b,all_objects c WHERE p.addr=a.paddr AND a.process=b.process AND c.object_id=b.object_id 如果表因为某些情况出现死
1.Oracle查询数据库中所有表的记录数,但是有可能不准建议用第二种方式进行查询 select t.table_name,t.num_rows from user_tables t 2.创建oracle函数,通过函数中查询词表记录数显示当前记录数 create or replace function count_rows(table_name in varchar2, owner in varchar2 default null) return number authid current_us
查询数据库中所有表名 select table_name from information_schema.tables where table_schema='csdb' and table_type='base table'; 查询指定数据库中指定表的所有字段名 select column_name from information_schema.columns where table_schema='csdb' and table_name='users';
SQLSERVER 1.查询某个数据库中所有的表名: SELECT Name FROM SysObjects Where XType='U' ORDER BY Name 2.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name
//查询所有表明 select name from sysobjects where xtype='u' select * from sys.tables //查询数据库中所有的表名及行数 SELECT a.name, b.rows FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id WHERE (a.type = 'u') AND (b.indid IN (0, 1)) ORDER BY a.name,b.rows DE
原文地址:http://blog.csdn.net/pukuimin1226/article/details/7687538 ----查询数据库中用户创建的表 ----jsj01 为数据库名 select name tablename from jsj01..sysobjects where type='U' and name not in ('dtproperties') --查询表里的字段信息 exec sp_help 对象名 ---docs为表名 select * from syscolu
1.查询包含某字段的所有表 select object_name(id) objName,Name as colName from syscolumns where (name like'%你要查询的字段名%') and id in(select id from sysobjects where xtype='u') order by objname ; 2.查询包含某字段的所有存储过程 SELECT obj.Name 存储过程名, sc.TEXT 存储过程内容 FROM syscomments
sql server 数表: select count(1) from sysobjects where xtype='U' 数视图: select count(1) from sysobjects where xtype='V' 数存储过程 select count(1) from sysobjects where xtype='P' SELECT * FROM sysobjects WHERE (xtype = 'U') C = CHECK 约束 D = 默认值或 DEFAULT 约束 F
sql server 数表: select count(1) from sysobjects where xtype='U' 数视图: select count(1) from sysobjects where xtype='V' 数存储过程 select count(1) from sysobjects where xtype='P' SELECT * FROM sysobjects WHERE (xtype = 'U') C = CHECK 约束 D = 默认值或 DEFAULT 约束 F