This article will show you how you can get the no of tables, Views, Stored Procedures, Functions in a Database like my sql, ms sql.
So here are the query which is used for getting the count of different database objects.
COUNT NO TABLE QUERY
COUNT NO VIEW QUERY
COUNT NO STORED PROCEDURE QUERY
COUNT NO FUNCTION QUERY
So here are the query which is used for getting the count of different database objects.
COUNT NO TABLE QUERY
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE
table_schema = 'Your
Table Name';
|
COUNT NO VIEW QUERY
SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS
|
COUNT NO STORED PROCEDURE QUERY
SELECT COUNT(*) AS
PROCEDURE_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE =
'PROCEDURE'
|
COUNT NO FUNCTION QUERY
SELECT COUNT(*) AS
FUNCTION_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE =
'FUNCTION'
|
0 comments:
Please let me know your view