Using UTC time and using offset values can be one of the best ways to make sure you capture the correct local time based on […]
How to rerun SQL query after delay?
This sample show how to run the same query with delay. It will keep running the same query with 10 second delay and keep re-executing […]
Database Backup Percentage Complete Status
When performing backup with scripts its not easily possible to get the percentage complete of the running backup. This simple script will show status of […]
How to get list of new or modified database objects?
This simple query tells us if there were any database objects created within the last 24 hours. You can modify the DATEADD parameters to get […]
How to get total row count of all database tables?
This script will create a temp table and store the name of the database table and total row counts for each table in the database. […]
SSRS Report Run History
The following query shows report history for a report name (Employee Attendance Report) in the WHERE clause. This is a great way to check what […]
How to get server disk space on SQL
Run the following extended stored procedure and you will get the disk space in MBs on each drive on your server. EXEC MASTER..xp_fixeddrives​
How to fix DBCC errors?
How to repair your database when you get DBCC errors. Put the database in single user mode. ALTER DATABASE YourDBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; […]
Rename Database By closing connections
When trying to rename database with open database connections its always a pain as the admin has to kill those connections. Instead of going that […]
How to read registry entries for SQL?
Following query shows all the registry values on the server. select[registry_key],[value_name],[value_data]from [sys].[dm_server_registry]