Category Archives: SQL

INVENTORY – SQL- SSAS – SSRS – Excel Output – Email

Inventory Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of the servers you manage.This inventory can take any number of forms but, ideally, will allow some aggregation of information. When … Continue reading

Posted in PowerShell, SQL, SSAS, SSRS, T-SQL | Tagged , , , , , , , | 2 Comments

PowerShell – SSRS Inventory – Automatic – Excel File – EMAIL

Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of the servers you manage. Download the file and save as SSRSInventory.PS1. It has five mandatory parameters InputFileName – Text File … Continue reading

Posted in PowerShell, SQL, SSRS | Tagged , , , | Leave a comment

PowerShell – SQL Inventory – Automatic – Excel File – EMAIL

Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of the servers you manage. Download the file and save as SQLInventoryExcel.PS1. It has Five mandatory parameters InputFileName – Text File … Continue reading

Posted in PowerShell, SQL | Tagged , , , | 7 Comments

PowerShell – Restart Service – Local or Remote Machines

This post is to start the services of local or remote computers. It also check for all its dependent services.  The script works on below logic Service status is Running The script will stop the dependent services ,stop the main … Continue reading

Posted in PowerShell, SQL | Tagged , | 1 Comment

SQL – Find CPU,Memory,Connections, VLF’s,I/O of all the Databases

Find CPU, Memory, No Of Connections/databases and VLF’s and I/O details in one single script.  You just need to run the below T-SQL in SSMS Download the code here Metrics ***************************************************************************** USE MASTER GO DECLARE @DML1 nvarchar(MAX), @DML2 nvarchar(MAX), @DML3 nvarchar(MAX), … Continue reading

Posted in SQL | Tagged , , , , | 4 Comments

SQL – Identify & Drop Duplicate Index

This post explains the simple steps to identify a duplicate indexes in all the databases.  The duplicate index are more than one indexes that differ only by it’s name but consist of identical fields internally. It generates overhead when performing updates, inserts … Continue reading

Posted in SQL, T-SQL | Tagged , , , | 4 Comments

SQLCMD – Database Backup and Restore – Automation – Quickest and Simplest method

In today’s world we rely more on third party tools to do a Backup and Restore of databases. Most of us still use SQL Native method to do a Database Backup and Restoration. This post illustrates the quickest way of … Continue reading

Posted in Backup and Restore, Robocopy, SETVAR, SQL, SQLCMD, Uncategorized | Tagged , , , | 7 Comments

SQL – One Query to fetch SQL Jobs Details of All SQL Version – 2000/05/08/R2

Single Query to fetch complete details of sql jobs and you can run it across different version of SQL [2000/2005/2008 and R2]. I’ve undergone dynamic query string limitation issue and hence I’m including the workaround details in the same post. … Continue reading

Posted in SQL, T-SQL | Tagged , , , , | 5 Comments

SQL – Find Database File Usage Details – 2000/05/08/R2

This post is to find the database file usage details of all databases of an instance. The query runs on all versions of sql 2000/2005/2008/R2 . The requirement is to use same query to be executed it across all version … Continue reading

Posted in SQL, T-SQL | Tagged , , , , , | Leave a comment

SQL – Query to find data,log,Total Size and other Useful information of all databases – SQL 2000/2005/2008/R2

I’ve encountered a situation where I need to find out the database file,log file, total size and other useful information about a database on SQL Server 2000/2005/2008/R2 versions. The requirement is to use same query and it has to be … Continue reading

Posted in SQL, T-SQL | Tagged , , , | 10 Comments