Monty Hall Simulation using T-SQL

  The first time I heard about the Monty Hall problem was while watching TV. The host of the TV show had presented the problem as you typically see. I am recapping it for your benefit now.    The TV show has three doors. Behind one of which there is a prize. The guest is…

Part 2:- Learning T SQL for beginners – Datatypes

In the previous post I talked about what Microsoft SQL Server programming language (T-SQL) is about. I also explained what a table is and what basic information is requires. In this post we’re going to continue the discussion on tables a bit further. Now we try to understand some more features that we need to provide the table in order…

Part 1:- Learning T SQL for beginners- SQL, Tables and Nulls

Learning SQL is easy when you have a good understanding of the basics. Everything else is based on the basics and it’s been the same since RDBMS (relational database management systems) have been launched. In this series of posts I hope to provide you with a good understanding of the basics and help you start…

Simple Function to capitalize a string

Recently I was required to write a function that would capitalize the 1st letter in every word. This is a fairly common requirement and I felt that there would be some good syntax or code available on the Internet. On Googling I did find a couple of links but they all felt a bit cumbersome…

Boolean Hell – Missed rows when grouping in SQL

I was recently asked about the concept of Boolean hell and thought it would be a good post to discuss. Most database professionals should be familiar with the concept even if they don’t know the exact name of it. I think the best way to explain this will be with an example so let’s have…

No process is on the other end of the pipe

Recently I got the below error when trying to connect to SQL Server. There error was caused in this case because the max memory setting was set to 1024 MB (on purpose). The error message mentioned that memory could be an issue as shown below in bold. The client was unable to establish a connection…

Adding a subscribe button to your WordPress site

Recently in a move to improve the subscription rate and overall search ranking of my site I decided to add a subscribe button to all my posts. The button would point the reader to my YouTube channel. This achieves 2 goals Improves the number of links to my channel as well as blog Makes it…

Memory for Servers – Hardware

Most database administrators are at least to some extent familiar with what memory does for SQL server. This is especially true for scenarios such as configuring minimum memory in maximum memory, checkpoint, lazy writer etc. However, there is a shocking lack of understanding how the hardware itself plays a key role in the memory utilisation of the server. Ask any database administrator…

Managing inventory in SQL Server –Part 1

A fairly important aspect of retail software is inventory management. Often this requires some kind of counter that reduces the count of stock items based on the number of orders placed. This poses a particularly difficult challenge in relational databases because we need to ensure consistency. Think of a product table which has a stock…

Securing SQL Server: – Data Classification and Vulnerability Assessment

  A big challenge with implementing security is just being able to keep track of the different tables and columns where the data is located. This features in SQL 2019 or SSMS specifically makes the task much easier. We cover how to automatically and manually classify sensitive information, we then explore how to audit SQL…

Securing Azure AD using the free stuff

One of the first things I did in 2021 was to log into Azure portal and check my Active Directory. You can imagine how much of a shock it would have been to me to see the screenshot below. Apparently I have been a target for a number of attacks from Pakistan, Indonesia and Vietnam….

Masking Data prior to SQL 2016

I was recently asked by a friend of mine what would be the best way to mask data in SQL Server. Now you may be aware that dynamic data masking was introduced in Microsoft SQL server version 2016. However for older versions of SQL server there are primarily just a few variations of same approach…