我们有时候会需要查询数据库中包含某字段的所有的表,去进行update,这时就可以用下面的SQL来实现: 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; 当然也可以使用游标,把查询出来的Table串接起来,如下: DE…
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…
查询数据库中所有表名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 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 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';…
场景:查询DNMes数据库中所有包含RFID字段的表名 sql语句: 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 测试查询sql语句: select object_name(id) objName,Name a…