Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
428 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Some other pages relevant to these blogs include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
|
Using the new vector data type in SQL Server 2025 Part one of a two-part series of blogs |
|---|
|
SQL Server 2025 introduces a completely new data type - the vector - which is aimed squarely at AI developers.
|
In this blog
Microsoft's main aim in introducing the new vector data type is to allow AI developers to create machine learning models within SQL Server. The first part of this blog looks at what the vector type is (and how to use it), while the second part gives a simple case study.
If you're going to be creating and storing models in SQL Server you'll also want to Google the AI_GENERATE_EMBEDDINGS function and CREATE EXTERNAL MODEL command, among others, but these are beyond the scope of this blog!
Before looking at the new SQL vector data type, it's worth asking the question: what is a vector? In SQL terms it's a single column of floating point numbers, which usually represents text in a numerical way.
For example, you can use the publicly available OpenAI Tokenizer to generate the numerical tokens representing any series of text:

Here I'm asking the tokenizer to say how it would represent Wise Owl Training in numbers in the GPT-4o model.
If you click on the Token IDs button the tokenizer will show the numerical representation of this phrase as it would be stored in the GPT-40 model:

The word Wise will always be encoded as 95705, no matter where it appears.
This is a vector of 3 numbers (although they would have to be converted from integers into floating point numbers before you could store them in a vector column in SQL Server.
When you create a vector column you have to specify how many numbers it will contain (for our example above we'll specify each vector contains 3 numbers). Here's some SQL to create a table holding the above tokenised phrase (and one other, Microsoft SQL Server) in a table:
-- get rid of any old version of the table
-- we are about to create
DROP TABLE IF EXISTS tblVectorExample
-- create a table to hold some vectors
CREATE TABLE tblVectorExample (
VectorExampleId int primary key identity,
VectorDescription varchar(max) not null,
TokenVector vector(3)
);
-- insert our "Wise Owl Training" tokens into this
INSERT INTO tblVectorExample (
VectorDescription,
TokenVector
) VALUES (
'Wise Owl Training',
'[95705, 131147, 19988]'
)
-- add "Microsoft SQL Server" in tokens
INSERT INTO tblVectorExample (
VectorDescription,
TokenVector
) VALUES (
'Microsoft SQL Server',
'[25667, 13033, 13261]'
)
-- show the results
SELECT * FROM tblVectorExample
This is what this will return:

This shows that although SQL Server stores vector fields in binary format, it exposes them (presents them to you, the human) in readable JSON, which you can manipulate using SQL.
This is what the first token vector looks like in a text editor:
[ 9.5705000e+004, 1.3114700e+005, 1.9988000e+004 ]
The above example shows 3 important limitations of the vector field type:
Limitation | Notes |
|---|---|
It's fixed length | There is no equivalent of varchar(max) - you must decide how long each vector you're storing will be in advance. |
It's single dimensional | Unlike in (for example) NumPy in Python, any vector just stores a single column (or row, if you prefer) of numbers. |
It has fixed data type | Vectors store each number using the float32 4 byte data type (although there is a preview feature which allows you to downgrade this to float16) |
If these limitations seem quite restrictive, bear in mind that data submitted to AI models is held in fixed-length single-dimension vectors, as we'll see in the second part of this blog.
| Parts of this blog |
|---|
|
Some other pages relevant to these blogs include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.