Question: How to drop clustered index, which is created on primary key?
Answer: If you thought the answer as simple as following script, you are wrong.
DROP INDEX PK_Table1_Col1
ON Table1
GO
Question: How to drop clustered index, which is created on primary key?
Answer: If you thought the answer as simple as following script, you are wrong.
DROP INDEX PK_Table1_Col1
ON Table1
GO
Question: When we drop clustered index on the column, does it automatically drop primary key on the same column (if created)?
Question: When we drop primary key on the column, does it automatically drop a clustered index on the same column (if created)?
Answer: This is one of the most popular questions, whenever I ask this to any candidate, they usually give an answer in yes or no. However, if I ask them follow up question to confirm, I have noticed most of the time they change the reply or accept that they really do not know the answer. It is totally fine. As when I was beginning with SQL, I even did not know the answer of it. I learn doing various experiments and doing various interviews.
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.
There are a few questions I often get asked. I wonder how interesting is that in our daily life all of us have to often need the same kind of information at the same time. Here is the example of the similar questions about index count: