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”
T-SQL and Jumbled Strings
I was working on a self assigned project and needed a database to work with but I just didn't want to use samples available. So I created a new database and now I wanted to populate it. I was wondering that while I can populate a table with numbers, what about strings? I decided on … Continue reading T-SQL and Jumbled Strings
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
How I track LDF size increase and VLF in real time?
Sometimes, we need to monitor logfiles on a database while we perform an activity. Like changing datatype of a table column, inserting/ updating or deleting many rows from a table, etc. in a single batch. Since we don't want to get the file out of control as it would fill up the disk and fail … Continue reading How I track LDF size increase and VLF in real time?
Would you trust missing index hints all the time?
Sometimes, when some DBAs are tasked with checking the performance of a query, they will run it and check the execution plan. see a missing index hint, they will copy the syntax and reply on email with the same index suggestion to deploy. While it is definitely better than nothing, we shouldn't assume its the … Continue reading Would you trust missing index hints all the time?
Can you trick your DBA into giving you [SYSADMIN]?
Why you ask? For Science. Few years back, I had a debate (( ͡° ͜ʖ ͡°)) with a senior over why DBA should verify and see if someone secretly slips in ALTER SERVER ROLE [sysadmin] ADD MEMBER [test] within their 200 lines of SQL Statements. The idea was that I have to press Ctrl + … Continue reading Can you trick your DBA into giving you [SYSADMIN]?
Log Backup Failed; No Current Backup Exists
Don't you hate it when you are on-call and some random application database all of a sudden starts failing their log backups? You get a call at 3:00 am and you know you can't ignore this call because if you do , the log file will fill up and make your life even worse. On … Continue reading Log Backup Failed; No Current Backup Exists