12 Coding tips for my younger self — Parv The IT Geek

Over the years I have written quite a lot of code. These are the tips that I wish I had known when I had started out and would have saved me a lot of head scratching and restless nights: Create a “to do” list Photo by David Ballew on Unsplash Always write down your tasks and keepContinue reading “12 Coding tips for my younger self — Parv The IT Geek”

My top tips for new programmers — Parv The IT Geek

Over the years I have written quite a lot of code. These are the tips that I wish I had known when I had started out and would have saved me a lot of head scratching and restless nights: Create a “to do” list. Always write down your tasks and keep it updated as youContinue reading “My top tips for new programmers — Parv The IT Geek”

Why you should learn programming — Parv The IT Geek

I remember when one of my friends got a summer job where he was asked to remove certain special characters from filenames and replace it with an underscore. He complained it was boring and tedious but it paid well so he stuck at it. He was expected to do a certain amount of files perContinue reading “Why you should learn programming — Parv The IT Geek”

How to change the collation of a database in SQL Server? — Parv The IT Geek

Have you ever wondered how to change the collation for a database in SQL Server? Well the other day I received a database from a third party supplier and the first step was to change the Collation of the database. My questioning about why they would supply the database in the incorrect collation setting wasContinue reading “How to change the collation of a database in SQL Server? — Parv The IT Geek”

SQL Server Collations Find current collation and all supported collations — Parv The IT Geek

Have you ever needed to check your database or SQL instance to find out its collation? Have you ever wanted to check whether a collation is supported by Windows or SQL Server? Well I am going to show you how to find out the information quickly and easily. The below query will show the instanceContinue reading “SQL Server Collations Find current collation and all supported collations — Parv The IT Geek”

Generate random numbers in PowerShell with Get-Random — Parv The IT Geek

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 butContinue reading “Generate random numbers in PowerShell with Get-Random — Parv The IT Geek”

Statistical Aggregate functions in SQL Server — Parv The IT Geek

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 SalesOrderDetailContinue reading “Statistical Aggregate functions in SQL Server — Parv The IT Geek”

SQL Cursor to Kill all connections to a database — Parv The IT Geek

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. DECLAREContinue reading “SQL Cursor to Kill all connections to a database — Parv The IT Geek”

SQL Cursors — Parv The IT Geek

Cursors are a way of manipulating data and interacting with them one at a time. They have a bad reputation within the SQL world as they go against the SET based logic and they can have a very high performance cost. Where possible you should ask yourself whether you could avoid using a Cursor. ThisContinue reading “SQL Cursors — Parv The IT Geek”

WHILE, BREAK, and CONTINUE Statements — Parv The IT Geek

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 DECLARE @i int = 1;Continue reading “WHILE, BREAK, and CONTINUE Statements — Parv The IT Geek”