Last active
December 31, 2015 19:59
-
-
Save Sounds-of-Science/8037488 to your computer and use it in GitHub Desktop.
Useful SQL commands
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
| -- Display all the database names on the instance | |
| EXEC sp_databases | |
| -- Display database size | |
| USE database_Name; | |
| GO EXEC sp_spaceused N'table_Name'; | |
| GO | |
| -- Put the db in read-only mode | |
| USE master EXEC sp_dboption 'Nom_Database', 'read only', 'TRUE' | |
| -- Put the db offline | |
| EXEC sp_dboption 'Nom_Database', Offline, 'True' | |
| -- Display log size | |
| DBCC SQLPERF (LOGSPACE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment