SQL SERVER – Script to Get Compiled Plan with Parameters From Cache

Lots of people often ask me as I share pretty everything on the blog – Do I have any Business Secrets. Actually, the answer is no, I never keep any secrets. I always share everything I know and I want my customers and readers learn along with me. Today I will share another script which I have written which I frequently use with my consulting engagement Comprehensive Database Performance Health Check.

Read More

SQL SERVER – XML Document Could Not be Created Because Server Memory is Low. Use sp_xml_removedocument to release XML documents

Most of my earnings come from my role as SQL Server Performance Tuning and Optimization consultant. Every single day I work with few customers so that I can maintain the quality of my work with each of them. As you can imagine, I face new challenges and learn new ways to tune SQL Server. In this blog post, we will discuss an error XML document could not be created because server memory is low. Use sp_xml_removedocument to release XML documents.

Read More

SQL SERVER – How to Generate Random Password? – Enhanced Version

Earlier last month, I posted an interview question – How to Generate Random Passwords in SQL Server? – Interview Question of the Week #181. Though, my efforts were honest my answer was not complete in that blog post. Thankfully, SQL Server Expert Tim Cartwright noticed the error in the blog post and decided to send me to follow up email with the accurate script to generate a random password.

Read More

SQL SERVER – Execution Plan Ignores Tabs, Spaces and Comments

Just another day I was delivering my training SQL Server Performance Tuning Practical Workshop, I noticed that organizations had many stored procedures but none of the SP had any comments. When I asked them why their Stored Procedures does not have comments, their point was that they believed because of the comments, the size of the execution plan increases. Not True, when SQL Server builds an execution plan, it ignores tabs, spaces, and all the comments.

Read More