PowerShell: Prevent Accidental Runs of Scripts

The problem and it's a big one! You might want to read this to the end! You are into PowerShell and have a ton of scripts. The problem is some of them run things that are not meant to be run at any time by anyone except you when you first set it up 🙂 … Continue reading PowerShell: Prevent Accidental Runs of Scripts

PowerShell: Recursion And Finding Loops In A Hierarchy With Active Directory Example

Recently, a friend of mine asked me about the best way to find loops in a hierarchy, specifically with Active Directory groups that may be nested (either by design or by mistake) thereby causing loops and this recursion based solution was my recommended answer for him. The Problem: Here is the example he gave me: … Continue reading PowerShell: Recursion And Finding Loops In A Hierarchy With Active Directory Example

Hard-coding Values In SQL Code – Please Don’t

What is hard-coding? Wikipedia defines it as below Hard coding (also, hard-coding or hardcoding) refers to the software development practice of embedding what may, perhaps only in retrospect, be regarded as input or configuration data directly into the source code of a program or other executable object, or fixed formatting of the data, instead of … Continue reading Hard-coding Values In SQL Code – Please Don’t

SQL Server Dynamic SQL – Use Bind Variables

Dynamic SQL – SQL that is constructed by putting together strings to form executable code that gets parsed for the first time by the compiler at run-time. Justification for Dynamic SQL? There should be relatively few instances where dynamic SQL is the only option. Generally, regular SQL whose syntax can be checked by the compiler … Continue reading SQL Server Dynamic SQL – Use Bind Variables

Oracle – LAG & LEAD – Usage Examples + Interesting Use-case

LAG and LEAD are a couple of analytic functions that come in handy in some interesting situations. I am not really sure why I wrote this post but at least it gives you a a few queries to play with LEAD and LAG. I am not completely happy with how this post turned out. Nothing … Continue reading Oracle – LAG & LEAD – Usage Examples + Interesting Use-case