Personal Development, Ruby Challenge

Ruby Rails challenge

I overheard a conversation the other day in the office about some of my colleagues all challenging themselves to do an Iron Man race as they always wanted to do it and they thought it would be fun to do it as well. This got me thinking about my own dreams and challenges I could… Continue reading Ruby Rails challenge

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

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

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

T-SQL

TSQL Challenge on BeyondRelational.COM

I was asked by one of my junior colleagues to help him with a puzzle he had seen on BeyondRelational.COM which I thought would be a nice challenge. I liked the premise of the scenario and I always liked a challenge decided to show my colleague how I would approach and resolve this problem. I was… Continue reading TSQL Challenge on BeyondRelational.COM

T-SQL

IF ELSE Control of flow statements

The IF ELSE statements are one of the most frequently used statement within SQL and control of flow statements are one of the core statements within any programing language. Once you have understood the concept you can easily make powerful scripts. An IF statement is a check to see whether a condition is TRUE and… Continue reading IF ELSE Control of flow statements