SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

PowerSQL By Prashanth Jayaram

Technology enthusiast with 7+ years of experience in Database Technology. I am Microsoft Certified Professional with certificates of OCA, MCP, MCTS, MCITP developer, MCITP administration and backed with a degree in Master of Computer Application. My expertise lies in T-SQL programming, Replication, PowerShell and Performance Tuning. Hobbies are Drawing, playing soccer and listening to Melodies songs.

Archives: July 2013

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 executed across all version of SQL SERVER.  We can  also… Read more

10 comments, 4,097 reads

Posted in PowerSQL By Prashanth Jayaram on 25 July 2013

PowerShell – Identify and switch between installed PowerShell Versions

Most of the time we have been used to cmdlets and it’s various features but do not know about the version and hence this post might help some of you to understand in finding different versions of PowerShell and how to switch between versions (provided multiple versions are installed on… Read more

3 comments, 1,237 reads

Posted in PowerSQL By Prashanth Jayaram on 17 July 2013

PowerShell – Get CPU Details and its Usage

This PowerShell script helpful in finding No of Processors, Speed and It’s current usage based on samples being gathered at frequent intervals.

/* Get No of Processors,Speed and its usage*/

Function Get-CPUs {
param ($server)
$processors = get-wmiobject -computername $server win32_processor
$cpuSpeed = ((get-wmiobject -computername $server Win32_Processor).MaxClockSpeed)/1000
if (@($processors)[0].NumberOfCores) Read more

2 comments, 1,421 reads

Posted in PowerSQL By Prashanth Jayaram on 11 July 2013

PowerSQL – Find OS and Memory Usage Details – Multi Server Script – No Input files

Multi Server script to find OS and Memory details.  It doesn’t require a text file as its input but you have to pass computer names as its parameters which are separated by comma.

function Get-OSMemory {
[string[]]$ComputerName = “.”

foreach ($Computer in $ComputerName) {
if(Test-Connection -ComputerName $Computer -Count… Read more

2 comments, 803 reads

Posted in PowerSQL By Prashanth Jayaram on 9 July 2013

SQLCMD –Quick Copy of Files – Using Robocopy

The requirement is to move the files to different server programatically and hence I’ve decided to use Robocopy in SQLCMD.

Robocopy is a command line utility. It has been available as part of the windows resource kit and It’s one of the fastest way to copy files across network.

–Robocopy… Read more

3 comments, 1,671 reads

Posted in PowerSQL By Prashanth Jayaram on 5 July 2013

PowerSQL – SQL Instance Configuration & Installation Information by Reading Registry Keys

Today I got a chance to retrieve configuration information of sql server 2005 instances. PowerShell provide a facility to read the registry information with ease. PowerShell treats the registry like any other location or directory. One critical difference is that every item on a registry-based Windows PowerShell drive is a… Read more

1 comments, 1,017 reads

Posted in PowerSQL By Prashanth Jayaram on 2 July 2013