An attempt to deploy a large language model for precise SQL generation across an enterprise MSSQL database with 253 tables and 3,550 columns hit a harsh engineering reality: the entire schema contained exactly three textual field descriptions. Internal benchmarking revealed that theoretical debates over Text-to-SQL architectures become irrelevant when the underlying system lacks basic metadata.

Engineers tested three distinct approaches using the MiniMax-M2 model: dynamic agentic search via the Model Context Protocol (MCP), schema linking for pre-filtering tables, and brute-force stuffing of the entire schema—along with 346 enum mappings—directly into a 58,000-token context window. Even the most heavyweight scenario cost roughly $1.20 per full run thanks to rock-bottom inference pricing at $0.26 per million tokens. Yet critical errors persisted, caused not by weak model reasoning, but by business logic hardcoded into legacy C# backend services rather than documented in the database itself.

Investing in fashionable agentic frameworks and premium frontier models cannot rescue neglected legacy databases. Systematic schema documentation and realistic context unit economics yield far better enterprise ROI than complex architectural overlays.

AI AgentsLarge Language ModelsAI in BusinessDigital Transformation