All Articles indexwithoutclusteredinex-600x400

Interview Question of the Week #062 – How to Find Table Without Clustered Index (Heap)?

Question: How to Find Table Without Clustered Index (heap)?

Answer: In SQL Server, when we create a primary key it automatically creates clustered index on the table, unless we explicitly mentioned not to create one. Due to this reason, the most of the table where there is a primary key, there are good chances it is also a clustered index key.

Read More
All Articles file-format-error-01-600x200

SQL SERVER – Installation Error – File Format is Not Valid

The reason I love consulting is because I get to see many flavors of the problems. This new avatar for me is pushing the limits to how I keep learning technologies. My recent interaction with client has shown one more error and another angle to look at a problem. Though some of these errors are new, it is a great way to understand how SQL Server actually works. In this blog post we will see Installation Error.

Read More

Comparison – Understanding Tables Between Oracle and SQL Server

Oracle has a Heap-organized table which SQL Server calls “Heap”
Oracle’s “Clustered” tables are called “Indexed Views” in SQL Server
Both Oracle and SQL Server have “Partition” & “Temporary” tables
Oracle’s “External” tables are called “Linked Servers” in SQL Server.
Oracle’s “Object” table is called “Table Type” in SQL Server.
Oracle’s “Index-organized” tables are referred to as a “Clustered index” in SQL Server.
Oracle does not have an equivalent/term for SQL Server’s In-Memory OLTP table
And Oracle’s “Hybrid columnar” compressed tables are called “Column store clustered index” in SQL Server.

Read More
All Articles nolock

SQL SERVER – The NOLOCK Question – Notes from the Field #117

[Note from Pinal]: This is a 117th episode of Notes from the Field series. Everytime I go to do performance tuning consultancy, one thing annoys me and makes me angry. The usage of NOLOCK hint. I think without any argument, this is one of the most abused query hint in the SQL Server universe. Lots of people treat NOLOCK as a silver bullet of performance tuning and that is unfortunate. There is a special purpose of how NOLOCK should be used and what is the end goal of it.

In this episode of the Notes from the Field series database expert Stuart Ainsworth explains about NOLOCK and its best practices. Trust me, you do not want to overuse NOLOCK hint as it can just impact your database integrity negatively.

Read More
All Articles syspurge-04-548x400

SQL SERVER – syspolicy_purge_history job failing step: Erase Phantom System Health Records

Getting back to consulting mode has got my newer clients and bigger challenges. Not only that I am seeing interests for some of the greatest and latest versions, but some clients are sitting on an older version of SQL Server requiring some serious help for trivial issues. One of my clients has asked to consult for a quick error message troubleshooting in the recent past. Since it was an interesting one about syspolicy_purge_history job, I am sharing it via the blog.

Read More
All Articles error-500x400

SQL SERVER – Setup Closed with Exit Code 0x80004005

Recently I was trying to help one of my clients to install Service Pack 3 for SQL Server 2008 R2 instance. Nothing was coming up when we were hitting setup.exe. I looked into my own blog and found Installation Log Summary File Location – 2012 – 2008 R2. But there was no file getting generated. I looked around of MSDN and found: https://docs.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files?redirectedfrom=MSDN&view=sql-server-ver15. The reason was there was exit code 0x80004005.

Read More
All Articles configuration

Interview Question of the Week #061 – How to Retrieve SQL Server Configuration?

I have observed this question in the interview question few days ago. I had a fun time to see candidates failing to answer this question. The most common answer candidate gave us was that they will right click on the server and see the properties. Well, that option will not give all the details which actual question intended. Let us see the question:

Question: What is the best way to see all the options set for your SQL Server programmatically?

Answer:

Read More
All Articles Status-bar-001-600x400

SQL SERVER – Management Studio – Changing Status Bar Location

To error is human and sometimes the errors / mistakes we make can easily put our jobs at stake. Such horror stories are something I keep hearing from people and they are super cool in a way because you learn from their experiences. In a recent corridor conversation with a friend, he said how cool he found my blog on: SQL SERVER – Color Coding SQL Server Management Studio Status Bar. He personally felt this was a cool thing. But he said even after that, it is sometimes difficult because the status bar location is at the bottom. I asked what is your screen resolution – he replied (2560 x 1440).

Read More