{"id":3232,"date":"2024-05-21T12:25:47","date_gmt":"2024-05-21T19:25:47","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sql\/?p=3232"},"modified":"2025-09-19T15:02:05","modified_gmt":"2025-09-19T22:02:05","slug":"announcing-eap-native-vector-support-in-azure-sql-database","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sql\/announcing-eap-native-vector-support-in-azure-sql-database\/","title":{"rendered":"Announcing EAP for Vector Support in Azure SQL Database"},"content":{"rendered":"<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Latest update - 19 June 2025<\/strong><\/p>Vector Support is now <strong>Generally Available<\/strong> in all regions! Read the announcement here: Announcing General Availability of Native Vector Type &amp; Functions in Azure SQL. Access to full documentation here: <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/data-types\/vector-data-type?view=azuresqldb-current&amp;tabs=csharp\">Vector data type<\/a>.<\/div><\/p>\n<p>We are super excited to announce the Early Adopter Preview of <strong>Native Vector Support<\/strong> in Azure SQL Database and are currently accepting requests from customers who wish to participate.<\/p>\n<h2>SQL beyond RDBMS<\/h2>\n<p>Vector databases have gained a lot of prominence lately. These specialized repositories handle vector data, crucial for applications like semantic search, chatbots, and recommendation systems.<\/p>\n<p>However, a paradigm shift is underway: Why maintain a separate Vector database when Azure SQL Database can seamlessly accommodate vector embeddings?<\/p>\n<p>By integrating vector search into Azure SQL, you simplify application development, coexisting with operational data for efficient similarity searches, joins, and aggregations\u2014all while leveraging Azure SQL\u2019s sophisticated query optimizer and robust enterprise features.\nThe integration of vector search within RDBMS allows customers to perform vector similarity searches alongside traditional SQL queries, enhancing data analysis and decision-making.<\/p>\n<h2>Embeddings<\/h2>\n<p>Embedding is the mathematical representation of objects (such as words, paragraphs, documents, images, or audio) as dense vectors. These vectors are typically generated by deep learning models and are instrumental in various machine learning and AI applications. By translating data into a vector space, embeddings can effectively capture and quantify the semantic similarities between related concepts, facilitating tasks such as semantic search and natural language processing.<\/p>\n<p>Embeddings capture semantic similarity between similar concepts. For example, consider word embeddings: Clusters of related words emerge (e.g., \u201ccomputer,\u201d \u201csoftware,\u201d \u201cmachine\u201d in one cluster; \u201clion,\u201d \u201ccow,\u201d \u201ccat,\u201d \u201cdog\u201d in another). The gap between clusters highlights dissimilarity in meaning or context<\/p>\n<p>The real complex part is calculating the embeddings, but thanks to Azure OpenAI, everyone has an easily accessible REST service that can be used to get the embeddings using pre-trained ML models. Once the embeddings are generated, they can be stored into a SQL Server database. This allows you to store the embeddings alongside the data they represent, and to perform vector search queries to find similar data points.<\/p>\n<p>A great article to understand how embeddings work, is the following: <a href=\"https:\/\/openai.com\/blog\/introducing-text-and-code-embeddings\" target=\"_blank\" rel=\"noopener\">Introducing text and code embeddings<\/a>.<\/p>\n<h2>Vector Search Use Cases<\/h2>\n<p>Vector search refers to the process of finding all vectors in a dataset that are similar to a specific query vector. Therefore, a query vector for the word human searches the entire dataset for similar vectors, and thus similar words: in this example it should find the word person as a close match. This closeness, or distance, is measured using a distance metric such as cosine distance<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/Screenshot-2024-05-16-183942.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3219\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/Screenshot-2024-05-16-183942.png\" alt=\"Image Screenshot 2024 05 16 183942\" width=\"956\" height=\"450\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/Screenshot-2024-05-16-183942.png 956w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/Screenshot-2024-05-16-183942-300x141.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/Screenshot-2024-05-16-183942-768x362.png 768w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/embeddings\/what-are-embeddings\">Similarity\u00a0<\/a><a href=\"https:\/\/platform.openai.com\/docs\/guides\/embeddings\/what-are-embeddings\">enables applications such as:<\/a>\u200b<\/p>\n<ul>\n<li><strong>Search<\/strong>\u00a0(where items are ranked by relevance to a query string)\u200b<\/li>\n<li><strong>Clustering<\/strong>\u00a0(where items are grouped by similarity)\u200b<\/li>\n<li><strong>Recommendations<\/strong>\u00a0(where related items are recommended)\u200b<\/li>\n<li><strong>Anomaly detection\u00a0<\/strong>(where outliers with little relatedness are identified)\u200b<\/li>\n<li><strong>Diversity measurement\u00a0<\/strong>(where similarity distributions are analyzed)\u200b<\/li>\n<li><strong>Classification<\/strong>\u00a0(where items are classified by their most similar label)<\/li>\n<\/ul>\n<h2>Feature Exploration<\/h2>\n<p>Azure SQL natively supports vectors allowing you to create, store and search vectors. Vectors are stored in a compact binary format so that calculating distance between two vectors is done in the fastest and most efficient way possible.<\/p>\n<p>There are 4 functions introduced to perform operations on vectors in binary format and generated vectors can be stored in a <code class=\"language-sql\">VECTOR<\/code> column or variable:<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"width: 234px;\"><strong>Function<\/strong><\/td>\n<td style=\"width: 382px;\"><strong>Description<\/strong><\/td>\n<td style=\"width: 382px;\"><strong>11 Sept Update<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 234px;\">JSON_ARRAY_TO_VECTOR (Deprecated)<\/td>\n<td style=\"width: 382px;\">Creates a vector from a JSON array<\/td>\n<td style=\"width: 382px;\">Not needed anymore, you can CAST a JSON array string like &#8216;[1,2,3]&#8217; to VECTOR<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 234px;\">ISVECTOR (Deprecated)<\/td>\n<td style=\"width: 382px;\">Tests whether a binary contains a valid vector<\/td>\n<td style=\"width: 382px;\">Not needed anymore as vector type assure correct format already<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 234px;\">VECTOR_TO_JSON_ARRAY (Deprecated)<\/td>\n<td style=\"width: 382px;\">Returns a vector as a JSON array<\/td>\n<td style=\"width: 382px;\">Not needed anymore, you can CAST a JSON array from vector to NVARCHAR to get a JSON array string back<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 234px;\">VECTOR_DISTANCE<\/td>\n<td style=\"width: 382px;\">Calculates the distance between two vectors using a specified distance metric<\/td>\n<td style=\"width: 382px;\">No changes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>Let us walk through an example of using Azure SQL DB to Create, Store Vector embeddings and perform similarity searches using our new functions.<\/p>\n<p>The table has been created using the customer reviews dataset from <a href=\"https:\/\/www.kaggle.com\/datasets\/pookam90\/fine-food-reviews-with-embeddings\/data\">FineFoods<\/a> and enriching it with embeddings generated via the <em>text-embedding-small<\/em> Azure OpenAI model.<\/p>\n<p>The embeddings have been generated using the concatenation of <em>Summary + Text<\/em> field.<\/p>\n<p>Imagine a user asks, \u201cWhat\u2019s the best coffee?\u201d We\u2019ll transform their query into a vector and search our database of reviews to extract all products that are similar to provided question.<\/p>\n<p>Let\u2019s look at the data loaded in the table:<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">SELECT TOP(10) * FROM [dbo].[FineFoodReviews] ORDER BY Id<\/code><\/pre>\n<p>Results:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3211\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1.png\" alt=\"contents of finefoodreviews table\" width=\"1765\" height=\"334\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1.png 1765w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1-300x57.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1-1024x194.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1-768x145.png 768w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/blog1-1536x291.png 1536w\" sizes=\"(max-width: 1765px) 100vw, 1765px\" \/><\/a><\/p>\n<h2>Storing Vectors<\/h2>\n<p>To have the broadest compatibility with any language and platform in the first wave vectors will take advantage of existing VARBINARY data type to store vector binary format.<\/p>\n<p>Add the New Column: vector with the type <code class=\"language-sql\">VECTOR(1536)<\/code><\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">ALTER TABLE [dbo].[FineFoodReviews] ADD [VectorBinary] VECTOR(1536);<\/code><\/pre>\n<p>Update the new column with the transformed data from the embedding column using the below function.<\/p>\n<h3>Creating a vector from a JSON array<\/h3>\n<p>We will cast the embeddings &#8211; stored as JSON Array &#8211; to the vector type, to create a compact binary representation of a vector<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">UPDATE [dbo].[FineFoodReviews]\r\nSET [VectorBinary] = CAST([vector] AS VECTOR(1536));\r\nGO<\/code><\/pre>\n<p>Vectors are now stored in an efficient binary format that also enables usage of dedicated CPU vector processing extensions like SIMD and AVX.<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">SELECT TOP(5) ID, ProductId, Summary, Text, VectorBinary FROM [dbo].[FineFoodReviews] ORDER BY Id<\/code><\/pre>\n<p>Result:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3227\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1.png\" alt=\"Image vectorbinary\" width=\"1455\" height=\"198\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1.png 1455w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1-300x41.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1-1024x139.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorbinary-1-768x105.png 768w\" sizes=\"(max-width: 1455px) 100vw, 1455px\" \/><\/a><\/p>\n<p>Specialized functions will allow developers to transform stored vector data back into JSON arrays and to check and mandate vector dimensionality<\/p>\n<h3>Getting a JSON array from vector<\/h3>\n<p>To transform the compact binary format to a human-readable string format you can just cast the vector binary format to a string:<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">SELECT TOP(5) ProductId, Summary, VectorBinary, CAST(VectorBinary as NVARCHAR(MAX)) AS jsonvector FROM [dbo].[FineFoodReviews] ORDER BY ID\r\n<\/code><\/pre>\n<p>Result:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3224\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray.png\" alt=\"Image vector to jsonarray\" width=\"1739\" height=\"201\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray.png 1739w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray-300x35.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray-1024x118.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray-768x89.png 768w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vector_to_jsonarray-1536x178.png 1536w\" sizes=\"(max-width: 1739px) 100vw, 1739px\" \/><\/a><\/p>\n<h3>Using a REST service to get embeddings<\/h3>\n<p>OpenAI models are available as REST endpoints and thus can be easily consumed from Azure SQL Database using the <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/system-stored-procedures\/sp-invoke-external-rest-endpoint-transact-sql?view=azuresqldb-current&amp;tabs=request-headers\">sp_invoke_external_rest_endpoint<\/a> system stored procedure:<\/p>\n<p>Using a call to a REST service to get embeddings is just one of the integration options you have when working with SQL Database and OpenAI.<\/p>\n<p>You can let any of the available models access data stored in Azure SQL Database to create solutions where your users can interact with the data as shown <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/azure-sql\/database\/ai-artificial-intelligence-intelligent-applications?view=azuresql#intelligent-applications\">here<\/a><\/p>\n<p>For this specific sample you have to deploy an embeddings model <code class=\"language-default\">text-embedding-small <\/code>model, the same used for the source we are using in this sample. Once that is done, you need to get the API KEY and the URL of the deployed model and use in the below example<\/p>\n<p>For example, you can use the stored procedure to get embeddings :<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">CREATE PROCEDURE [dbo].[GET_EMBEDDINGS]\r\n(\r\n    @model VARCHAR(MAX),\r\n    @text NVARCHAR(MAX),\r\n    @embedding VECTOR(1536) OUTPUT\r\n)\r\nAS\r\nBEGIN\r\n    DECLARE @retval INT, @response NVARCHAR(MAX);\r\n    DECLARE @url VARCHAR(MAX);\r\n    DECLARE @payload NVARCHAR(MAX) = JSON_OBJECT('input': @text);\r\n\r\n    -- Set the @url variable with proper concatenation before the EXEC statement\r\n    SET @url = 'https:\/\/&lt;resourcename&gt;.openai.azure.com\/openai\/deployments\/' + @model + '\/embeddings?api-version=2023-03-15-preview';\r\n\r\n    EXEC dbo.sp_invoke_external_rest_endpoint \r\n        @url = @url,\r\n        @method = 'POST',   \r\n        @payload = @payload,   \r\n        @headers = '{\"Content-Type\":\"application\/json\", \"api-key\":\"&lt;openAIkey&gt;\"}', \r\n        @response = @response OUTPUT;\r\n\r\n    -- Use JSON_QUERY to extract the embedding array directly\r\n    DECLARE @jsonArray NVARCHAR(MAX) = JSON_QUERY(@response, '$.result.data[0].embedding');\r\n\r\n    \r\n    SET @embedding = CAST(@jsonArray as VECTOR(1536));\r\nEND\r\nGO\r\n<\/code><\/pre>\n<p>You can now call the stored procedure and use the embedding for similarity search against already stored embeddings as we will see below.<\/p>\n<h3>VECTOR_DISTANCE<\/h3>\n<p>This function calculates the distance between two vectors using a specified distance metric.<\/p>\n<p>The following distance metrics are supported:<\/p>\n<ul>\n<li><strong>cosine<\/strong> &#8211; Cosine distance<\/li>\n<li><strong>euclidean<\/strong> &#8211; Euclidean distance<\/li>\n<li><strong>dot<\/strong> &#8211; (Negative) Dot product<\/li>\n<\/ul>\n<p>Example Syntax: The following example creates a vector with three dimensions from a string with a JSON array<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">DECLARE @v1 VARBINARY(8000) = JSON_ARRAY_TO_VECTOR('[1,1]')\r\nDECLARE @v2 VARBINARY(8000) = JSON_ARRAY_TO_VECTOR('[-1,-1]')\r\n\r\nSELECT \r\n    VECTOR_DISTANCE('euclidean', @v1, @v2) AS euclidean,\r\n    VECTOR_DISTANCE('cosine', @v1, @v2) AS cosine,\r\n    VECTOR_DISTANCE('dot', @v1, @v2) AS negative_dot_product;<\/code><\/pre>\n<h2>Similarity Search in Azure SQL DB<\/h2>\n<p>We now have the <code class=\"language-default\">finefoodreviews<\/code> table enriched with vector Embeddings for the customer reviews.<\/p>\n<p>Let us now query our embedding table to get the top similar reviews given the User search query. Given any user search query, we can get the vector representation of that text. Then we can use that vector to calculate the cosine distance against all the customer review comments stored in the database and take only the closest ones which will return the product most likely connect to the product we are interested in. The reviews with the highest similarity are considered the most relevant to the query, helping users discover products or experiences related to their search.<\/p>\n<ul>\n<li>We start by converting the user\u2019s text query into its vector representation using an embedding model\nUser text query :<code class=\"language-sql\">\"healthy options instead of coke\"<\/code><\/li>\n<li>The resulting vector represents the semantic meaning of the query.<\/li>\n<\/ul>\n<p>Cosine distance is then calculated between this query vector and the embeddings of reviews in our dataset.<\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">--Assuming you have a stored procedure to get embeddings for a given text\r\nDECLARE @e VECTOR(1536);\r\nEXEC dbo.GET_EMBEDDINGS @model = '&lt;yourmodeldeploymentname&gt;', @text = 'healthy options instead of coke', @embedding = @e OUTPUT;\r\n\r\nSELECT TOP(10) ProductId,\r\n               Summary,\r\n               Text,\r\n               VECTOR_DISTANCE('cosine', @e, VectorBinary) AS Distance\r\nFROM dbo.FineFoodReviews\r\nORDER BY Distance;\r\n<\/code><\/pre>\n<p>Result:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3225\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch.png\" alt=\"Image vectorsearch\" width=\"1698\" height=\"333\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch.png 1698w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch-300x59.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch-1024x201.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch-768x151.png 768w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/vectorsearch-1536x301.png 1536w\" sizes=\"(max-width: 1698px) 100vw, 1698px\" \/><\/a><\/p>\n<p>You can see the power of semantic search by finding reviews that are contextually related to the search query, even if they don\u2019t contain exact match keywords.<\/p>\n<h2>Hybrid Search<\/h2>\n<p>Let&#8217;s look at a simple example of using Keyword Filters which leverages both semantic and keyword-based techniques to enhance search results. The below query combines filters to narrow down the review set and then calculates cosine distances to prioritize semantically related reviews. This approach balances relevance and computational efficiency.<\/p>\n<p>We filter reviews based on specific criteria:<\/p>\n<ul>\n<li>Exclude anonymous users.<\/li>\n<li>Include reviews with a score of 2 or higher.<\/li>\n<li>Consider only detailed reviews (text length &gt; 50 characters).<\/li>\n<li>Include reviews containing specific words like \u201cgluten\u201d or \u201cdairy.\u201d<\/li>\n<\/ul>\n<p>We calculate the cosine distance between each review\u2019s embedding and the query embedding based on user text <code class=\"language-default\">\"quick fix breakfast option for toddlers\"<\/code><\/p>\n<pre class=\"prettyprint language-sql\"><code class=\"language-sql\">-- Assuming you have a stored procedure to get embeddings for a given text\r\nDECLARE @e VECTOR(1536);\r\nEXEC dbo.GET_EMBEDDINGS @model = '&lt;yourmodeldeploymentname&gt;', @text = 'quick fix breakfast option for toddlers', @embedding = @e OUTPUT;\r\n\r\n-- Comprehensive query with multiple filters.\r\nSELECT TOP(10)\r\n    f.Id,\r\n    f.ProductId,\r\n    f.UserId,\r\n    f.Score,\r\n    f.Summary,\r\n    f.Text,\r\n    VECTOR_DISTANCE('cosine', @e, VectorBinary) AS Distance,\r\n    CASE \r\n        WHEN LEN(f.Text) &gt; 100 THEN 'Detailed Review'\r\n        ELSE 'Short Review'\r\n    END AS ReviewLength,\r\n    CASE \r\n        WHEN f.Score &gt;= 4 THEN 'High Score'\r\n        WHEN f.Score BETWEEN 2 AND 3 THEN 'Medium Score'\r\n        ELSE 'Low Score'\r\n    END AS ScoreCategory\r\nFROM FineFoodReviews f\r\nWHERE\r\n    f.UserId NOT LIKE 'Anonymous%' -- User-based filter to exclude anonymous users\r\n    AND f.Score &gt;= 2 -- Score threshold filter\r\n    AND LEN(f.Text) &gt; 50 -- Text length filter for detailed reviews\r\n    AND (f.Text LIKE '%gluten%' OR f.Text LIKE '%dairy%') -- Inclusion of specific words\r\nORDER BY\r\n    Distance,  -- Order by distance\r\n    f.Score DESC, -- Secondary order by review score\r\n    ReviewLength DESC; -- Tertiary order by review length\r\n<\/code><\/pre>\n<p>Result:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword.png\"><img decoding=\"async\" class=\"size-full wp-image-3228 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword.png\" alt=\"Image semanticpluskeyword\" width=\"1773\" height=\"319\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword.png 1773w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword-300x54.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword-1024x184.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword-768x138.png 768w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2024\/05\/semanticpluskeyword-1536x276.png 1536w\" sizes=\"(max-width: 1773px) 100vw, 1773px\" \/><\/a><\/p>\n<p>Hence, we can see that vector search enhances semantic understanding and relevance, while traditional search provides simplicity and direct matches<\/p>\n<h2>More Samples<\/h2>\n<p>You can find more end-to-end samples at <a href=\"https:\/\/github.com\/Azure-Samples\/azure-sql-db-vector-search\">Azure-Samples\/azure-sql-db-vector-search (github.com)<\/a><\/p>\n<h2>Private Preview Sign-up<\/h2>\n<p>We are currently accepting requests from customers who would like to participate in the private preview and try out the Native Vector Support for SQL feature. If you are interested, please fill out <a href=\"https:\/\/aka.ms\/azuresql-vector-eap\">https:\/\/aka.ms\/azuresql-vector-eap<\/a><\/p>\n<p><a href=\"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.png\"><img decoding=\"async\" class=\"size-medium wp-image-3210 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=\"Image QRCode for Vector Support in Azure SQL Database Private Preview Sign up 1\" width=\"300\" height=\"300\" srcset=\"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 300w, 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-1024x1024.png 1024w, 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-150x150.png 150w, 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-768x768.png 768w, 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-1536x1536.png 1536w, 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-24x24.png 24w, 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-48x48.png 48w, 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-96x96.png 96w, 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.png 1890w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Wrapping up<\/h2>\n<p>Our journey to enhance SQL\u2019s Vector capabilities has just begun with the Early Adopter preview. Join us in shaping the future of SQL databases by participating in the early adopter preview of Native Vector Support.\nYou can submit your feedback using\u00a0<a href=\"https:\/\/aka.ms\/sqldbregex-feedback\">this Form<\/a>\u00a0or leave a comment on this blog.<\/p>\n<p>Thank you for choosing Azure SQL Database as your data platform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are super excited to announce the Early Adopter Preview of Native Vector Support in Azure SQL Database and are currently accepting requests from customers who wish to participate. SQL beyond RDBMS Vector databases have gained a lot of prominence lately. These specialized repositories handle vector data, crucial for applications like semantic search, chatbots, and [&hellip;]<\/p>\n","protected":false},"author":159391,"featured_media":3233,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[601,599,1,594,582,576,577,615],"tags":[602,510,588,561,410,591],"class_list":["post-3232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-azure-openai","category-azure-sql","category-hyperscale","category-openai","category-rest","category-rest-endpoint-invocation","category-vectors","tag-azure-openai","tag-azure-sql-database","tag-azure-sql-db","tag-openai","tag-rest","tag-vector-search"],"acf":[],"blog_post_summary":"<p>We are super excited to announce the Early Adopter Preview of Native Vector Support in Azure SQL Database and are currently accepting requests from customers who wish to participate. SQL beyond RDBMS Vector databases have gained a lot of prominence lately. These specialized repositories handle vector data, crucial for applications like semantic search, chatbots, and [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/3232","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\/159391"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/comments?post=3232"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/3232\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media\/3233"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media?parent=3232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/categories?post=3232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/tags?post=3232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}