Learn about the WAITFOR TIME & WAITFOR DELAY — Parv The IT Geek

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. SELECT GETDATE() WAITFOR DELAY ’00:00:10′; BEGIN SELECT GETDATE() END; The above code shows you how toContinue reading “Learn about the WAITFOR TIME & WAITFOR DELAY — Parv The IT Geek”

Declaring Variables and Retrieving Variables — Parv The IT Geek

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. PRINT CURRENT_TIMESTAMP Jan 15 2015 11:44AM The CURRENT_TIMESTAMP result can beContinue reading “Declaring Variables and Retrieving Variables — Parv The IT Geek”

IF ELSE Control of flow statements — Parv The IT Geek

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 andContinue reading “IF ELSE Control of flow statements — Parv The IT Geek”

Output results from PowerShell to CSV or XML — Parv The IT Geek

Have you wanted to output results from PowerShell to CSV or XML? Well I am going to show you how. I have previously explained how to export results of PowerShell queries but did not include how to export the results to CSV or XML. The reason for that is that when you become familiar withContinue reading “Output results from PowerShell to CSV or XML — Parv The IT Geek”

Simple way to output results to a file using PowerShell — Parv The IT Geek

Have you ever wanted to send the output of a PowerShell command to a file? Well I am going to show you how. When you run a PowerShell command like Get-Process, Get-Host…. It will return useful information but sometimes you want to save that information for future reference. You could cut and paste or takeContinue reading “Simple way to output results to a file using PowerShell — Parv The IT Geek”

Hello World in C# — Parv The IT Geek

Have you ever wanted to reach the first milestone in programming by writing a Hello World application in C#? Well I am going to show you the script to produce the program. I was asked by a member of our helpdesk team how he could become a programmer. I answered that he should start withContinue reading “Hello World in C# — Parv The IT Geek”

Get the Operating System Properties via PowerShell — Parv The IT Geek

Have you ever wanted to get all the operating system properties of a computer? Well I am going to show you a short PowerShell script which can get loads of information about the operating system. One of my colleagues was googling around for information about how to find the windows directory, number of users, lastContinue reading “Get the Operating System Properties via PowerShell — Parv The IT Geek”

List SQL databases in SQL Server — Parv The IT Geek

Have you ever wanted to list out all the databases you have on a server? Well I am going to show you how to do it quickly and easily. The other day I had completed a migration from a creaky old dinosaur server to a brand new powerful server which always brings a smile onContinue reading “List SQL databases in SQL Server — Parv The IT Geek”

Have you ever wanted to convert a US date to UK format using SQL? — Parv The IT Geek

Have you ever come across the situation where you have data in US format and need it changed to UK format? Well I am going to show you how to use SQL to easily reformat the date. I have had this problem several times in the past dealing with international clients who supply databases withContinue reading “Have you ever wanted to convert a US date to UK format using SQL? — Parv The IT Geek”

Search PowerShell help using wildcards — Parv The IT Geek

Have you ever wanted to search for new commands or have difficulty remember syntax? Well I recently found the wildcard search function within the help system and I am going to show you how to use it. You could use the commands feature which is below and can be accessed via Add-ons > Commands OrContinue reading “Search PowerShell help using wildcards — Parv The IT Geek”