Last active
November 14, 2018 17:17
-
-
Save attebury/79c8d6a51bc36ddaccda14a79421e924 to your computer and use it in GitHub Desktop.
MS SQL queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** https://stackoverflow.com/questions/219434/query-to-list-all-stored-procedures **/ | |
select * | |
from DatabaseName.information_schema.routines | |
where routine_type = 'PROCEDURE' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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