SQL Server 2025 introduces native vector data types with high-performance DiskANN indexing, in‑engine LLM support via **EXTERNAL MODEL**, REST‑based model management (Azure OpenAI, Ollama, Semantic Kernel), Copilot‑powered SSMS, real‑time event streaming, Azure Arc hybrid integration, and zero‑ETL analytics with Microsoft Fabric—empowering AI apps directly in T‑SQL.
What are the new AI features in SQL Server 2025?
- VECTOR(n) data type + vector functions/indexes: store high‑dimensional embeddings directly in the database, with optimized binary storage and JSON interchange.
- DiskANN vector index: ultra‑fast similarity searches for semantic matching—ideal for RAG, recommendation engines.
- EXTERNAL MODEL objects & model management: register, version, and invoke external LLMs or embedding models (Azure OpenAI, OpenAI, Ollama, etc.) via REST endpoints—with retry support.
- Copilot in SSMS 21: natural‑language assistant to write, optimize, or refactor T‑SQL—now generally available.
How to use AI and LLMs in T‑SQL?
1. Create vector columns & index
CREATE TABLE Products (
ProductID INT PRIMARY KEY,
Title NVARCHAR(200),
Description NVARCHAR(MAX),
Embedding VECTOR(768)
);
CREATE VECTOR INDEX idx_emb ON Products(Embedding) USING DISKANN;
2. Register an external model
CREATE EXTERNAL MODEL model_embeddings
WITH (ENDPOINT = 'https://api.openai.com/v1/embeddings', RETRY_COUNT = 3);
3. Populate embeddings
UPDATE Products
SET Embedding = model_embeddings.INFER(Description);
4. Perform semantic search
DECLARE @q VECTOR(768) = model_embeddings.INFER('wireless noise-canceling headphones');
SELECT TOP 10 *, Embedding <-> @q AS similarity
FROM Products
ORDER BY similarity;
5. Full RAG pipeline
DECLARE @doc NVARCHAR(MAX) = 'Features and benefits of wireless headphones...';
DECLARE @emb VECTOR(768) = model_embeddings.INFER(@doc);
SELECT TOP 5 *
FROM Documents
ORDER BY Embedding <-> @emb;
-- For each retrieved chunk, call an LLM for summarization or answer generation
LLM orchestration can be performed via external model calls or integrated frameworks (LangChain, Semantic Kernel).
What about LLM orchestration & frameworks?
- SQL Server 2025 directly supports LangChain & Semantic Kernel, so you can implement complex workflows (classification, summarization, RAG) entirely within the database.
- Model management in T‑SQL allows switching between providers without application changes—a major DevOps advantage.
How does it integrate with the data ecosystem?
- CDC: events are ingested in real-time to fuel AI triggers or dashboards through Change Event Streaming via Azure Event Hubs or Kafka.
- Fabric zero‑ETL mirroring: sync operational data to Microsoft Fabric for BI or analytical AI—no pipelines needed.
- Azure Arc hybrid & Entra-managed identities: universal control and secure identity management across on‑prem and cloud.
Conclusion – Why should developers & DBAs care?
- Faster AI prototyping: embed and query semantic data in-place—no Python layers or external vector DBs.
- Simpler architecture: combine transactions, indexing, analytics, and AI within one T‑SQL code base.
- Security & governance: model endpoints invoked with granular identity, auditing, and role-based controls.
- Real-time intelligence: Fabric sync and pipelineless CDC provide millisecond-fresh AI-powered insights.
- Productivity boost: Copilot accelerates T‑SQL coding and performance tuning in SSMS/VSCode-Copilot.