标签:comm ini nes tables microsoft 扩展 inner rom comment
SELECT NAME FROM sysobjects AS s INNER JOIN syscomments AS s2 ON s2.id = s.id WHERE TEXT LIKE ‘%关键字%‘ and s.xtype = ‘P‘
--查询存储过程与函数 SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE ‘%关键字%‘ AND ROUTINE_TYPE=‘PROCEDURE‘ --查询存储过程与函数的参数 select * from INFORMATION_SCHEMA.PARAMETERS --查询数据库的表与视图 select * from INFORMATION_SCHEMA.TABLES
2.查询外键关系
SELECT PT.name 引用表名,PC.name 引用列名,RT.name 被引用表名,RC.name 被引用列名 FROM sys.foreign_key_columns JOIN sys.objects PT ON sys.foreign_key_columns.parent_object_id=PT.object_id JOIN sys.objects RT ON sys.foreign_key_columns.referenced_object_id=RT.object_id JOIN sys.columns PC ON sys.foreign_key_columns.parent_object_id=PC.object_id AND sys.foreign_key_columns.parent_column_id=PC.column_id JOIN sys.columns RC ON sys.foreign_key_columns.referenced_object_id=RC.object_id AND sys.foreign_key_columns.referenced_column_id=RC.column_id where RT.name=‘Biz_Audit_MaterialBill‘
标签:comm ini nes tables microsoft 扩展 inner rom comment
原文地址:http://www.cnblogs.com/sky-gfan/p/7094864.html