Forum Discussion
SQL Server 2025 VECTOR functions accepting JSON array strings
- Jan 20, 2026
In SQL Server 2025, the new VECTOR functions like VECTOR_DISTANCE work only with actual VECTOR values. You can store a JSON array string in a VECTOR column because SQL Server can convert it when inserting, but the functions won’t automatically convert a JSON string to a VECTOR when you use it. You need to explicitly cast the JSON array to VECTOR first for the functions to work. Essentially, JSON arrays don’t magically become vectors you have to tell SQL Server to treat them that way.
In SQL Server 2025, the new VECTOR functions like VECTOR_DISTANCE work only with actual VECTOR values. You can store a JSON array string in a VECTOR column because SQL Server can convert it when inserting, but the functions won’t automatically convert a JSON string to a VECTOR when you use it. You need to explicitly cast the JSON array to VECTOR first for the functions to work. Essentially, JSON arrays don’t magically become vectors you have to tell SQL Server to treat them that way.