All Articles SSMS-startup-options-01-600x400

SQL SERVER – Configuring Startup Options for SQL Server Management Studio

Yesterday I started my day early to get to a gym. I know this was the first day and I had loads of work pending to be completed at work too. This got me busy and I started to drive my car, oblivious of the fact that I had to take a turn which I missed. Just while crossing the junction I realized I had missed it. It was a bad start to the day as I wasted 5 minutes to retrace back to the original route. On second thought, this mistake from my side got me thinking. My mind was tuned to specific routes and this is the same thought process that got me the inspiration to write this post. Let us learn how to configure startup options.

Read More
All Articles ro-attach-01

SQL SERVER – FIX Error 5120 – Database is in Read Only Mode After Attaching Files

Sometimes you need to know more about permissions on file, service account etc. to fix certain errors. In my recent visit to a customer location, one of the database developers came to me with a problem. He said that when he attaches MDF and LDF file to the SQL instance, attach is successful, but the issue was next to database name it was saying read-only. Let us see how we can FIX Error 5120.

Read More
All Articles jobsrunning-600x400

SQL SERVER – Displaying SQL Agent Jobs Running at a Specific Time

Recently I was troubleshooting at a customer location something that looked trivial. When the customer approached me for a consulting requirement wherein they were saying their system was going unresponsive every day in the morning around a certain time. They were clueless to what is happening and why this was the case almost every day in the week. I got curious to understand what was going wrong with SQL Agent Jobs.

Read More
All Articles backups-taken-ps-01-600x376

PowerShell – Script to Listing all Backups Taken with SQL Server

I always like to keep a number of scripts handy in my USB drive with my Laptop. These scripts are used for my internal use when I am suddenly looking for something interesting in customer environments. One of the scripts that I use is shown below. Many a times I have seen customers don’t really have any backup strategy. And when I start working with them, I call out some of the basic backup techniques that they need to be doing.

Read More
All Articles spcode-600x400

Fastest Way to Display Code of Any Stored Procedure – Interview Question of the Week #094

A very common question I often see users not sure about the answer. This is indeed a tricky question, but a very simple one. If I am the interviewer, I may ask this question to the user, but if they do not know the answer of this question, I would not give any negative remarks to interviewee. I think it is even old school to even ask these kind of questions. It has been long since I have stopped asking this question, once in a while, I still see this question being asked by my fellow colleagues. Well, let us revisit the age old question again about the fastest way to display code of any stored procedure.

Read More
All Articles get-process-02-600x400

PowerShell Scripts – get-process with SQL Server process

Working with powershell scripts can be interesting. I have in the past shown a number of such scripts that we can use with SQL Server. In this blog, I was playing around understanding how I can use the get-process commandlet and how it can be used with SQL Server. This exploration and playing around has got me to write this rather simple yet something useful blog that you might use in your environments.

Read More
All Articles trigger-update-batch-process-01-600x400

SQL SERVER – How to Avoid Triggers for Multiple Row Operations in a Table

Customers have a unique way to give you challenges that you never faced. It was one of those evenings that I was working late night on some SQL activity when I received a mail from one of my very old customers. It is rare that I get a ping from them and I was surprised at what had gone wrong. As I started to chat with them, he didn’t know I had recently moved to consulting. This got him double excited and I was unaware to why such a reaction. Your best customers are your best well-wishers too. Let us read about How to Avoid Triggers for Multiple Row Operations in a Table.

Read More
All Articles SSMS-white-421x400

SQL SERVER Management Studio – Why I am Seeing White Icon Instead of Green or Red?

One of my clients faced a strange situation. She was using SQL Server Management Studio and was not seeing SQL server and SQL Agent status. It was showing white circle. When she would right click the instance, the options of Start, Stop and Resume were disabled. She also said that she is having SysAdmin permissions in SQL Server (logging using the SA account).

Read More