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; […]
Missing SSIS Toolbox
In multiple different versions of Visual Studio (2010-2017) the toolbox tend to disappear in designer mode when working on SSIS packages. Select “SSIS” then “SSIS […]
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 restore a deleted report on reporting services?
First get the copy of the ReportServer database backup and restore it. Use the following step to restore. In SSMS right click the database folder […]
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]
How to get SQL Service details?
Run the following query under context of any system or user database to get the sql server database engine account and the account for sql […]
How to tell when data changed in a table?
This query will show list of each table when it was last scanned SELECTOBJECT_NAME(OBJECT_ID) AS TableName,[database_id],[object_id],[index_id],[user_seeks],[user_scans],[user_lookups],[user_updates],[last_user_seek],[last_user_scan],[last_user_lookup],[last_user_update],[system_seeks],[system_scans],[system_lookups],[system_updates],[last_system_seek],[last_system_scan],[last_system_lookup],[last_system_update]FROM sys.dm_db_index_usage_statsWHERE database_id = DB_ID( ‘NameOfDatabase’)​ Note: Replace the ‘NameOfDatabase‘ […]
Top SSRS Sites
MSSQLTips More to come