Implementing Document Chunking and Vector Search in Azure SQL Database
Azure SQL Database enables native document chunking and vector search using built-in T-SQL functions and Azure OpenAI integration. Developers can split text, generate embeddings, and query semantic data without a separate vector store, provided the database uses compatibility level 170 or higher.
What changed From the source
Azure SQL Database supports native text chunking and vector search capabilities directly through T-SQL. Using the AI_GENERATE_CHUNKS function, text can be split into fixed-size segments where an optional overlap percentage controls repeated text between adjacent chunks. The feature requires database compatibility level 170 or higher.
Embeddings are generated by calling an external Azure OpenAI endpoint via the AI_GENERATE_EMBEDDINGS function and stored in first-class VECTOR columns. The system supports similarity searches using functions like VECTOR_DISTANCE and index creation through CREATE VECTOR INDEX based on DiskANN.
- Introduced native AI_GENERATE_CHUNKS function for splitting text directly within T-SQL.
- Added AI_GENERATE_EMBEDDINGS to call external embedding endpoints such as Azure OpenAI.
- Introduced the VECTOR data type for storing numeric embeddings as first-class columns.
- Enabled similarity evaluation and indexing using VECTOR_DISTANCE and CREATE VECTOR INDEX.
At a glance · SQL Server & Data
What changedWhy it mattersWho should careUpgrade and migration considerations
Why it matters Analysis
Integrating text chunking and vector storage directly into Azure SQL Database allows development teams to evaluate retrieval-augmented generation patterns without provisioning and maintaining a separate vector database. By keeping product guidance and its corresponding vector metadata unified in a single system, applications can fetch focused context alongside original source details.
This approach simplifies application architectures where enterprise data already resides in Azure SQL Database, minimizing data synchronization overhead between disparate database engines.
- Reduces architectural complexity by removing the requirement for a secondary dedicated vector store.
- Keeps source documents, metadata, and chunked vector embeddings co-located.
- Streamlines the pipeline for grounding large language model responses using existing operational data.
Who should care Analysis
Database developers, backend engineers, and solution architects working with Azure SQL Database who want to incorporate semantic search or retrieval-augmented generation features will find these capabilities relevant. The techniques are particularly useful for teams looking to maximize the value of existing text data stored in SQL repositories.
- Architects evaluating semantic retrieval options on current Microsoft data estates.
- Developers implementing retrieval-augmented generation pipelines using familiar T-SQL constructs.
Upgrade and migration considerations Analysis
Upgrading existing databases to compatibility level 170 to support AI_GENERATE_CHUNKS requires careful review, as alterations to compatibility levels can potentially impact existing query plans. Thorough testing and approval from the database owner are recommended prior to making adjustments in production environments.
Additionally, external REST endpoint invocation and database-scoped credentials must be properly secured. Secrets should be managed using secure storage mechanisms such as Azure Key Vault rather than hardcoded scripts, and access permissions to external model endpoints require explicit configuration.
- Compatibility level 170 is mandatory for the chunking function, requiring pre-upgrade testing.
- Outbound network access to Azure OpenAI endpoints must be explicitly permitted and authenticated.
- Security practices dictate avoiding plain-text keys in shared files in favor of managed identities or secure secret stores.
Sources and further reading
- Original post on Azure SQL Dev Corner (original source)
Original: “How to Chunk Documents in Azure SQL Database for RAG”, Azure SQL Dev Corner, published 20 Nov 2026, retrieved 21 Nov 2026. This article was drafted with AI assistance from the official source and passed automated fact and quality checks. Spotted a mistake? See our corrections policy.