Skip to content

Instantly share code, notes, and snippets.

@attebury
Last active November 14, 2018 17:17
Show Gist options
  • Save attebury/79c8d6a51bc36ddaccda14a79421e924 to your computer and use it in GitHub Desktop.
Save attebury/79c8d6a51bc36ddaccda14a79421e924 to your computer and use it in GitHub Desktop.
MS SQL queries
/** https://stackoverflow.com/questions/219434/query-to-list-all-stored-procedures **/
select *
from DatabaseName.information_schema.routines
where routine_type = 'PROCEDURE'
/** https://stackoverflow.com/questions/175415/how-do-i-get-list-of-all-tables-in-a-database-using-tsql **/
SELECT TABLE_NAME FROM <DATABASE_NAME>.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'
/** https://stackoverflow.com/questions/2903262/sql-query-to-list-all-views-in-an-sql-server-2005-database **/
SELECT * FROM sys.views
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment