Get total number of tables, views, stored procedures and functions count and names in sql server
Below query will return the total number of tables in sql server
SELECT count(name) as tablecount FROM sys.sysobjects WHERE xtype = 'U'
Below query will return the total number of views in sql server
SELECT count(name) as viewscount FROM sys.sysobjects WHERE xtype = 'V'
Below query will return the total number of stored procedures in sql server
SELECT count(name) as spcount FROM sys.sysobjects WHERE xtype = 'P'
Below query will return the total number of functions in sql server
SELECT count(name) as fncount FROM sys.sysobjects WHERE xtype = 'FN'
If you want to get the names of all tables, views, stored procedures or functions then use the below queries
SELECT name FROM sys.sysobjects WHERE xtype = 'U'
SELECT name FROM sys.sysobjects WHERE xtype = 'V'
SELECT name FROM sys.sysobjects WHERE xtype = 'P'
SELECT name FROM sys.sysobjects WHERE xtype = 'FN'
Useful Tools
Online Code Editor and Compiler
HTML Minifier
Online HTML Compiler/Preivew
Word Count Tool
Replace Text/Word tool
Latest Blogs
How to check if a canvas is empty or blank
Maintain div or panel scroll position after postback in asp.net update panel
Draggable button using jquery ui
Get total number of tables, views, stored procedures and functions count and names in sql server
JavaScript function to get date in mmddyyyy hhmmss ampm forma