---
title: "Eleven SQL Server Interview Questions That Look Far Too Easy"
url: https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd
source_url: https://blog.sqlauthority.com/2026/08/20/eleven-sql-server-interview-questions-that-look-far-too-easy
type: article
source: "SQL Authority"
published: 2026-08-20T01:32:58.437Z
updated: 2026-08-20T04:10:10.593Z
tags: ["backend", "sql", "microsoft-sql-server", "interview-questions"]
reading_time: 21
upvotes: 2
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Eleven SQL Server Interview Questions That Look Far Too Easy

**[SQL Authority](https://daily.dev/sources/sql-authority)** · 21 min read · 2 upvotes · 0 comments

## Summary

Eleven SQL Server behaviors that trip up even senior engineers, tested and verified on SQL Server 2025 RTM-CU7. Covers ANSI padding making 'SQLAuthority' equal 'SQLAuthority ' despite LEN vs DATALENGTH disagreeing, why trailing-space detection differs for varchar vs char, SUM returning NULL versus COUNT returning 0 on empty tables, NULL comparisons silently excluding rows in WHERE clauses, integer division truncation, column alias scoping rules across WHERE and ORDER BY, IDENTITY values not being restored after ROLLBACK, deleting duplicate rows with no key, disabling a clustered index making a table completely inaccessible, an added index actually making a SELECT slower due to optimizer cost decisions, and foreign keys referencing unique (non-primary-key) columns plus silently allowed duplicate indexes. Each example includes runnable T-SQL and actual output, framed as interview questions meant to reveal real understanding rather than memorized trivia.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sqlauthority.com/2026/08/20/eleven-sql-server-interview-questions-that-look-far-too-easy>

## Questions this post answers

### Why does SQL Server say 'SQLAuthority' equals 'SQLAuthority ' with a trailing space?

SQL Server follows ANSI blank-padding rules, so the shorter string is padded with spaces before an equality comparison, making the two values equal regardless of collation (case-sensitive, accent-sensitive, or binary all treat them as equal). This only affects trailing spaces and only equality comparisons; LEN ignores trailing spaces (returns 12) while DATALENGTH counts them (returns 13), and LIKE does not follow the same padding rule and behaves asymmetrically.

_daily.dev surfaces practical SQL Server gotchas like this for developers debugging unexpected query results._

### Does disabling a clustered index in SQL Server just slow down queries or does it break the table completely?

Disabling a clustered index makes the entire table inaccessible immediately, not just slower, because the clustered index physically is the table. Both SELECT and INSERT statements fail with error 8655 stating the query processor cannot produce a plan. Recovery requires an ALTER INDEX ALL ... REBUILD statement, since there is no ENABLE command for a disabled clustered index.

_developers investigating index-related outages can track these SQL Server internals through daily.dev._

### Can adding a nonclustered index make a SELECT query slower in SQL Server?

Yes, forcing a query to use an index instead of letting the optimizer choose can more than double logical reads. In one test on a 500,000-row table where a filter matched about 2% of rows, an unindexed scan took 13,942 logical reads, adding an index without hints kept the optimizer at 13,942 reads (it chose to ignore the new index), but forcing the index with an INDEX hint pushed reads to 30,796 because seeking plus key lookups cost more than a full scan.

_engineers weighing index hints versus optimizer choices can follow SQL Server performance deep dives on daily.dev._

## Similar posts on daily.dev

- [SQL Has Rules You Don’t Notice Until Your Query Is Wrong](https://daily.dev/posts/sql-has-rules-you-don-t-notice-until-your-query-is-wrong-ue7ucmkyu) · Medium · 0 upvotes · 0 comments
- [Beautiful T-SQL Queries: Three Could Delete the Company](https://daily.dev/posts/beautiful-t-sql-queries-three-could-delete-the-company-ni51yxeeb) · SQL Authority · 36 upvotes · 7 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#sql](https://daily.dev/tags/sql), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server), [#interview-questions](https://daily.dev/tags/interview-questions)

[View this post on daily.dev](https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd)
