{"id":3582,"date":"2024-09-11T08:56:32","date_gmt":"2024-09-11T15:56:32","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sql\/?p=3582"},"modified":"2024-11-12T08:50:33","modified_gmt":"2024-11-12T16:50:33","slug":"eap-for-vector-support-refresh-introducing-vector-type","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sql\/eap-for-vector-support-refresh-introducing-vector-type\/","title":{"rendered":"EAP for Vector Support Refresh &#8211; Introducing Vector type"},"content":{"rendered":"<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/09\/new-vector-old-crt-1.jpeg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3596\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/09\/new-vector-old-crt-1.jpeg\" alt=\"Image new vector old crt\" width=\"1000\" height=\"500\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/09\/new-vector-old-crt-1.jpeg 1000w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/09\/new-vector-old-crt-1-300x150.jpeg 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/09\/new-vector-old-crt-1-768x384.jpeg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<h2>Latest update &#8211; 06 November 2024<\/h2>\n<p>Vector Support is now available as Public Preview! Read the announcement here: <a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/exciting-announcement-public-preview-of-native-vector-support-in-azure-sql-database\/\">Public Preview of Native Vector Support in Azure SQL Database!<\/a> Access to full documentation here: <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/vector-functions-transact-sql?view=azuresqldb-current\">Vector functions<\/a>.<\/p>\n<h2>The new <code>vector<\/code> data type<\/h2>\n<p>Not even 6 months ago <a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/announcing-eap-native-vector-support-in-azure-sql-database\/\">we started the Early Adopter Preview vector data support in Azure SQL<\/a>, and we got great feedback and a lot of enthusiasm about the feature. Developers are excited to be able to easily build AI-enabled solution using an enterprise ready, secure, scalable and proven platform like Azure SQL, without the need to move data outside the database for increased security and manageability.<\/p>\n<p>We&#8217;re now even more excited to introduce a dedicated, native, data type for storing vectors: the <code>vector<\/code> data type. Usage of <code>varbinary<\/code> to store vectors is now deprecated and it will be removed before we move to Public Preview. Having a vector type just makes everything easier. Creating a vector is now as easy as casting from a JSON array:<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">declare @v vector(3) = cast('[1,2,3]' as vector(3))<\/code><\/pre>\n<p>and converting a vector back into a JSON array is also straightforward:<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">declare @a nvarchar(max) = cast(@v as nvarchar(max))<\/code><\/pre>\n<p>Vector functions that were specifically focused on handling vectors using the <code>varbinary(8000)<\/code>, like <code>ISVECTOR<\/code>, <code>JSON_ARRAY_TO_VECTOR<\/code> and <code>VECTOR_TO_JSON_ARRAY<\/code> will still work for a while, but they are to be considered deprecated, as there is no need for them anymore now that vectors have their own data type.<\/p>\n<h2>New functions for vectors<\/h2>\n<p>We&#8217;re also introducing couple of new functions to facilitate vectors usage, especially if the embedding model that you are using does not return normalized vectors, so that you must use the more expensive cosine distance instead of the more efficient dot product:<\/p>\n<ul>\n<li><code>VECTOR_NORM<\/code>: returns the norm of the vector (which is a measure of its length or magnitude) in a given <a href=\"https:\/\/mathworld.wolfram.com\/VectorNorm.html\">norm type<\/a>.<\/li>\n<li><code>VECTOR_NORMALIZE<\/code>: returns the normalized vector, which is a vector scaled to have a length of 1 in a given <a href=\"https:\/\/mathworld.wolfram.com\/VectorNorm.html\">norm type<\/a>.<\/li>\n<\/ul>\n<h2>How do I test the vector type?<\/h2>\n<p>Using the new vector type is still in Early Adopter Preview phase.<\/p>\n<p><strong>If you have been already included in the Early Adopter Preview<\/strong>, and you are already using the vector functions, no action needed on your side. We&#8217;ll reach out to you in the next days to provide instructions on how to use the new vector type.<\/p>\n<p><strong>If you have already submitted your request to join the Early Adopter Preview<\/strong>, you&#8217;re good. When we&#8217;ll reach out to you, we&#8217;ll provide the updated information to use the new vector type right away.<\/p>\n<p><strong>If you are interested in joining the Early Adopter Preview<\/strong> to try out the new vector features firsthand, please fill out this form: <a href=\"https:\/\/aka.ms\/azuresql-vector-eap\" target=\"_blank\" rel=\"noopener\">https:\/\/aka.ms\/azuresql-vector-eap<\/a> so that you can be included EAP.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-large aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/QRCode-for-Vector-Support-in-Azure-SQL-Database-Private-Preview-Sign-up-1-300x300.png\" alt=\"Vector Support EAP Link\" width=\"300\" height=\"300\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Latest update &#8211; 06 November 2024 Vector Support is now available as Public Preview! Read the announcement here: Public Preview of Native Vector Support in Azure SQL Database! Access to full documentation here: Vector functions. The new vector data type Not even 6 months ago we started the Early Adopter Preview vector data support in [&hellip;]<\/p>\n","protected":false},"author":24720,"featured_media":3596,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[601,1,615],"tags":[590,569,591],"class_list":["post-3582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-azure-sql","category-vectors","tag-ai","tag-vector","tag-vector-search"],"acf":[],"blog_post_summary":"<p>Latest update &#8211; 06 November 2024 Vector Support is now available as Public Preview! Read the announcement here: Public Preview of Native Vector Support in Azure SQL Database! Access to full documentation here: Vector functions. The new vector data type Not even 6 months ago we started the Early Adopter Preview vector data support in [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/3582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/users\/24720"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/comments?post=3582"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/3582\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media\/3596"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media?parent=3582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/categories?post=3582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/tags?post=3582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}