Category Archives: SQL

PowerSQL – Different Approaches to Find Free Space in all disk drives

Different ways to find FreeSpace  in all disk drives of a given server T-SQL Using WMIObject Counters All three methods are explained below This post illustrates the simplest way of doing anything with ease using Powershell. I hope everyone agree … Continue reading

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

SQL- SP_PROCOPTION – AutoNotification to App Owners – When SQL Instance Restarts

We had a situation where Application owners automatically notified whenever server restarts.  The SP_PROCOPTION do have a facility to perform this activity. The SP_PROCOPTION built-in stored procedure being used to invoke the user defined stored proc automatically. The details of this … Continue reading

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

The scripting variables can be defined explicitly by using the setvar command or implicitly by using the sqlcmd -v option. Also, this is very helpful in Replication to check rowcount across publisher and subscriber articles. Explicit Call- SQLCMD can be … Continue reading

Posted on by Prashanth Jayaram | Leave a comment

PowerShell – Identify Service Account & Other Details of SQL Services – Multi Server Script

One of my friend requested me to give a mutli server script to pull SQL Service related details. Here is a quick PowerShell script to find Name, ServerName, Status, StartupMode, Service Account and other details of SQL Services across all … Continue reading

Posted in PowerShell, SQL | 5 Comments

SQL- Setup and Configure Backup Report – Step by Step Approach – All listed SQL Instances

One of SQL enthusiast asked me to include the complete code and wanted to schedule a SQL job. I’m trying to give more information with this post also including Step by Step procedure to setup and configure backup report. This is going … Continue reading

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

SQL – SQL Server Script to Iterate and Pull Data from All SQL Instances – Database Backup

This Post is a continuation of my previous post. Many times, there is a difficulty in pulling the data to centralized server. As I’ve already mentioned in my previous post PART1,  I’m explaining how to pull the  DATABASE BACKUP information from all listed instance … Continue reading

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

SQL – SQL Server Script to Iterate through All SQL Instances – Example Transaction Log Shrinking

There are many ways to execute SQL’s or T-SQL’s across listed SQL Instances. Most of us might have faced and handled this scenario. A script or SQL’s need to be executed across ‘N’ number of instances. This example which does … Continue reading

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

We came across a scenario where database bak files being created from long time which are no more in use and hence cleanup those files since we’ve backup tool is in place. We’ve many *.BAK (database backup files) created across … Continue reading

Posted on by Prashanth Jayaram | Leave a comment

PowerSQL – SQL Inventory Generation – Email – High Level Details

Inventory allows anyone to quickly and easily assess any environment. For few servers, answering  Inventory questions might not be so difficult.  But if you’re managing ‘N’ number of SQL Server instances then its going to be tedious job and you’re … Continue reading

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

PowerSQL – Identify a Head of the Database Blocks and Generate Automated Alert across all listed SQL Instances

This is going to be a simplest way of capturing and sending some useful information via an email of ‘N’ number of servers. With a little modification, you can implement various database related automation and capture very useful information. To Identify … Continue reading

Posted in PowerShell, SQL | Tagged , , | 1 Comment