Interview Question of the Week #040 – Difference Between Unique Index vs Unique Constraint

Question: What is the difference between unique index and unique constraint? Answer: Add Unique Constraint ALTER TABLE dbo.<tablename> ADD CONSTRAINT <namingconventionconstraint> UNIQUE NONCLUSTERED ( <columnname> ) ON [PRIMARY] Add Unique Index CREATE UNIQUE NONCLUSTERED INDEX <namingconventionconstraint> ON dbo.<tablename> ( <columnname> ) ON [PRIMARY] There is no difference between Unique Index…
Read More

Interview Question of the Week #039 – What is Included Column Index in SQL Server 2005 and Onwards?

You may find it interesting that not many people still know what is Included Index in SQL Server. I have seen it personally around me and also have seen at Question: What is Included Column Index? Answer:  In SQL Server 2005, the functionality of non-clustered indexes is extended by adding non-key…
Read More

Interview Question of the Week #021 – Difference Between Index Seek and Index Scan (Table Scan)

Question: What is the difference between Index Seek and Index Scan? Answer: Index Scan retrieves all the rows from the table. Index Seek retrieves selective rows from the table. Index Scan: Since a scan touches every row in the table whether or not it qualifies, the cost is proportional to the…
Read More

SQL SERVER – Mistake to Avoid: Duplicate and Overlapping Indexes – Notes from the Field #073

[Note from Pinal]: In this episode of the Notes from the Field series database expert Kathi Kellenberger explains about indexes and its impact. We often believe that indexes will improve the performance of the query, but it is not true always. There are cases when indexes can reduce the performance as well. Read…
Read More