Monthly Archives: October 2019

Pattern matching vs Fuzzy Lookup in SQL Server

By | October 29, 2019

I recently came across a post in Linkedin about a script that performs Pattern Matching or “Fuzzy Lookup” within TSQL. The Script was definitely an elegant solution to scoring similar words but it still wasn’t exactly Fuzzy Lookup it was pattern matching. Before we continue I guess it will be better to first explain the… Read More »

Turning into cyborgs

By | October 24, 2019

The Year is around 1964, Jawaharlal Nehru is the prime minister of India. India is reeling under Inflation and has borrowed so much that nobody will lend her any money. Droughts and the Wars have made the nation weary. Jobs are few and far between and most people are still dependent on the Governments socialist… Read More »

Writing good TSQL vs Bad

By | October 15, 2019

Saw this question on the forum and wanted to highlight how easy it is to over complicate a simple query. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/75264de5-9a32-40f4-b9ce-e430d77b77fe/case-when-is-not-working-please?forum=transactsql A perfect example of Programmatic access vs Set based querying. The developer has an unhealthy obsession with CASE statements and as you can see from the post he is now facing issues as a… Read More »

Tales from the crypt: – Passing multiple int values into a variable

By | October 15, 2019

Reference Post https://social.msdn.microsoft.com/Forums/en-US/7c04a296-3c26-4a43-ae63-bc90139f4ab3/error-converting-data-type-nvarchar-to-int?forum=sqlgetstarted I was browsing through the forums and found this question being asked. While the reason for the error is fairly obvious I felt it needed further investigation so here it is. The question being asked is why does the below query work While the next one fails Naturally anyone with any TSQL… Read More »

Generating TPC H data for testing

By | October 14, 2019

A common requirement I have is to generate test data. Sometimes for trainings and sometimes for consulting work. As you may have seen from many previous video and blogs typically use Airlines Ontime dataset for large databases and Mockaroo for smaller datasets. However recently I wanted to try and see if I could achieve comparable… Read More »