PowerShell

Generate random numbers in PowerShell with Get-Random

Generate random numbers in PowerShell with Get-Random Have you ever wanted to generate random numbers for passwords, test data…. and wondered how you could easily generate them? Well I was confronted by the same situation on one of our servers where I needed some random numbers for inputting wait times to test an application but… Continue reading Generate random numbers in PowerShell with Get-Random

T-SQL

ASCII String function in SQL Server

Have you wondered what the ASCII value of a character is whilst using SQL Server? Or needed to quickly check the ASCII value? Or wondered how the ASCII Function worked? Well the other day I saw one of the developers using the ASCII function which I was not familiar with so I decided to a… Continue reading ASCII String function in SQL Server

PowerShell

List Hotfixes installed with PowerShell with Get-Hotfix

Have you ever wondered what updates have been applied to your Windows operating system? Well a quick and easy way to do that is to use the PowerShell command Get-Hotfix. This will list out the description, the HotfixID and when it was installed. I used this on a few PCs where it appeared that updates… Continue reading List Hotfixes installed with PowerShell with Get-Hotfix

T-SQL

Statistical Aggregate functions in SQL Server

Have you ever wondered how to do program or perform simple statistical function within SQL Server? Well the kind people at Microsoft have enabled us to all to save time by giving us a few inbuilt functions which save us from having to solve them programmatically. I have used the unit Price column in the… Continue reading Statistical Aggregate functions in SQL Server

T-SQL

SQL Cursor to Kill all connections to a database

Have you ever tried to restore over a database but found that all attempts are being blocked by an annoying SPID? Or had hundreds of orphaned SPIDs running crazy on your instance? Well I have the solution for you with the below script which uses a cursor to kill all connections to a database. Make sure… Continue reading SQL Cursor to Kill all connections to a database

T-SQL

WHILE, BREAK, and CONTINUE Statements

Have you ever wondered how to create a loop in SQL? Or wondered how to break and escape a loop? Well I am going to briefly introduce you to the WHILE, BREAK, and CONTINUE Statements which will satisfy your curiosity The first command I will introduce you to is WHILE Loop As you can see… Continue reading WHILE, BREAK, and CONTINUE Statements

T-SQL

Learn about the WAITFOR TIME & WAITFOR DELAY

Have you ever wanted to pause a command for a short period or wanted to run a transaction at a specific time.   Well I am going to quickly show you how to do them both using the WAITFOR command. The above code shows you how to delay two print current date and time commands… Continue reading Learn about the WAITFOR TIME & WAITFOR DELAY

PowerShell

Powershell Alias List

Have you ever wandered whether you could speed up your script writing,shorten down your snippets or come across strange commands in PowerShell? Well PowerShell's Aliases would be the answer to all the above scenarios. I first came across them when I saw it in a friends script and could not ascertain what GDR was and… Continue reading Powershell Alias List

T-SQL

Declaring Variables and Retrieving Variables

A variable can be best described as being a place holder for information which you then fill in with relevant information which you will want to retrieve later. The below query shows the result from the CURRENT_TIMESTAMP which returns the current date and time. Jan 15 2015 11:44AM The CURRENT_TIMESTAMP result can be made into… Continue reading Declaring Variables and Retrieving Variables