Create Azure SQL Database using Terraform

Terraform is IAC (Infrastructure as a code). It is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. If you have to create new Azure SQL Databases with same configuration over and over for testing purpose and then decommission later, then this IAC is for … Continue reading Create Azure SQL Database using Terraform

Learning Web Crawling

This is a short update, I am learning Python or basically copying scripts from internet and altering to my needs so far. Here's a little personal project I have worked on. (This is not a tutorial post, just something I worked on and the method might not be efficient) I wanted to keep an eye … Continue reading Learning Web Crawling

Answering a deleted question – “The multi-part identifier could not bound”

Stackoverflow question got deleted while I was writing the answer for the person who posted their question. May be he deleted it as he found answer or someone else deleted it as duplicate question. In any case, if he is still seeking help, I hope he finds the answer. I am posting here incase it … Continue reading Answering a deleted question – “The multi-part identifier could not bound”

Optimize for Statistics – Fixing Parameter Sniffing

What is Parameter Sniffing? When a parameterized query or stored procedure is some times slow and sometimes fast. This phenomenon is called parameter sniffing. I wanted to learn it and therefore I did some experiments. For this example, I am using Stackoverflow2013 database. I created following index so I don't end up sleeping while the … Continue reading Optimize for Statistics – Fixing Parameter Sniffing

SP to get number of rows between ranges without reading table

I was working on a parameter sniffing issue ended up trying to understand statistics for the table. But I found that regular method gives too much information DBCC SHOW_STATISTICS ('TABLE_NAME', 'STATISTICS_NAME') I wanted to deep dive more so I googled and found a better script SELECT hist.step_number, hist.range_high_key, hist.range_rows, hist.equal_rows, hist.distinct_range_rows, hist.average_range_rows FROM sys.stats AS … Continue reading SP to get number of rows between ranges without reading table