SQL Server: Invalid column name 'x'. (Msg 207)
SQL Server can’t find the column — typo, missing migration, or a string in double quotes with QUOTED_IDENTIFIER ON.
Seen on:
SQL
Meaning
Double-quoted text is an identifier when QUOTED_IDENTIFIER is ON. Column aliases also can’t be used in WHERE.
Common causes
- Typo or missing column
- String literal in double quotes
- Using a SELECT alias in WHERE
⚡ Quick fix
- Use single quotes for strings
- Run migrations
- Repeat the expression or use a CTE instead of the alias in WHERE
Detailed fix by platform
SQL
WITH t AS (SELECT price * qty AS total FROM lines) SELECT * FROM t WHERE total > 100;
How to diagnose
- Column — Exists?
- Quotes — Double-quoted string?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026