SQL Flow Field Guide

Read an invalid-column error

Use an error number and message to choose the next check for a failed query.

What you are trying to do

A teammate shares a SQL Server error snapshot for a report that stopped with error 207. The learner must identify the useful clue and the next check.

Work through it

  1. Read the error number and message in the synthetic diagnostic row.
  2. Identify MissingColumn as the name SQL Server could not resolve.
  3. Choose to check the source columns and the spelling of the name.

Check your work

One diagnostic row appears for error 207. Its message names MissingColumn, and NextCheck says to inspect the source column names.

Practice SQL

Open in SQL Flow
SELECT ErrorNumber, ErrorMessage,
       CASE WHEN ErrorNumber = 207 THEN N'Check source column names'
            ELSE N'Read the error reference' END AS NextCheck
FROM (VALUES (207, N'Invalid column name ''MissingColumn''.')) AS Diagnostic(ErrorNumber, ErrorMessage);

Knowledge check

Commands in this lesson

Next lesson Design related tables with enforceable rules