Skip to content

Commit ad83899

Browse files
authored
updated readme
1 parent 8704a0f commit ad83899

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,21 @@ The **native option** uses the new Vector Functions, recently introduced in Azur
5454
> [!NOTE]
5555
> Vector Functions are in Public Preview. Learn the details about vectors in Azure SQL here: https://aka.ms/azure-sql-vector-public-preview
5656
57-
![](_assets/azure-sql-cosine-similarity-native.gif)
57+
```sql
58+
DECLARE @embedding VECTOR(1536)
59+
60+
EXEC [web].[get_embedding] 'I want to learn about security in SQL', @embedding OUTPUT
61+
62+
SELECT TOP(10)
63+
s.id,
64+
s.title,
65+
s.abstract,
66+
VECTOR_DISTANCE('cosine', @embedding, s.embeddings) AS cosine_distance
67+
FROM
68+
[web].[sessions] s
69+
ORDER BY
70+
cosine_distance
71+
```
5872

5973
The **classic option** uses the classic T-SQL to perform vector operations, with the support for columnstore indexes for getting good performances.
6074

-304 KB
Binary file not shown.

0 commit comments

Comments
 (0)