Useful SQL System Stored Procedure

September 16, 2011

tags: ,
no comments

1. Finding SQL Server Version:

Select @@version;


EXEC master..sp_MSgetversion

2. Finding SQL Databases names and size:

Use master;

EXEC sp_helpdb;

3. Finding the physical location of the SQL databases and logs:

SELECT name, physical_name AS current_file_location
FROM sys.master_files

4. Finding list of tables and views in SQL database:

Use master;

EXEC sp_tables;

5. Finding which user/s is/are currently logging to the SQL server:

EXEC sp_who;

6. Move to Advanced Configurations Mode:

USE master;
EXEC sp_configure ‘show advanced option’, ‘1’;
7. Reviewing Advanced Configurations Mode options:”


EXEC sp_configure;

8. Finding SQL Locking:

EXEC sp_lock

Add comment
facebook linkedin twitter email

Leave a Reply