Monday, February 24, 2025

SQL SERVER 2025, AI and Vector Search

  The advent of AI has ushered in ground breaking changes in most areas of technology. AI is synonymous with a humongous amount of data, data of all types including text, image, audio and video. The databases of the future needs to cater to this changing vista of data and yet compatible with existing technologies.

Microsoft SQL Server has always catered to the technological changes and along its developmental path has introduced many data types to handle diverse data varieties and in recent years has introduced data types such as, "Json', "Stock" and "Geographical" data types. These address  the stock market and the geographical data that accompanies all global operations. 

In addition to data types, it has also changed itself to accommodate not only relational data but also non-relational NoSQL type of data using integration with polyphase technology.

Vector Data Type

SQL Server 2025 has introduced a new **vector data type** designed to store vector data optimized for operations like similarity search and machine learning applications. This is quite a leap for a relational database management system (RDBMS), as it traditionally handles structured data but can handle NoSQL Data.

How is Vector datatype stored in the SQL Server 2025?

A vector in SQL Server is typically stored as a JSON array of floating-point values. Here's an example of how you might define and use a vector in SQL Server:

-- Create a table with a vector column

CREATE TABLE dbo.vectors (

    id INT PRIMARY KEY,

    v VECTOR(3) NOT NULL

);

-- Insert data into the table

INSERT INTO dbo.vectors (id, v) VALUES 

(1, '[0.11, 2, -35]'), 

(2, '[-100.2, 0.0123, 9.876]'

-- Select data from the table

SELECT * FROM dbo.vectors;

This table with two columns has a column of vector data type not null. The vectors are [0.11, 2, -35] and [-100.2, 0.0123, 9.876]

The columns store three dimensional vectors with each dimension stored as a single-precision floating point (float type).

Vector Data Type is not available in 2022

The vector data type is not available in SQL Server 2022. You may have to store vector data type in a JSON column or something customized.

Image Processing and AI

In recent times image processing has been intensely studied. One may ask how to store the dimensional representation of an image. Well, images can have a very high dimensional representation.

Grayscale Image: A 100x100 pixel grayscale image can be represented as a 10,000-dimensional vector (100x100 = 10,000).

Color Image: A 100x100 pixel color image with RGB channels can be represented as a 30,000-dimensional vector (100x100x3 = 30,000).

In SQL Server 2025, the maximum number of dimensions that can be stored using the vector data type is 1998. Each element of the vector is stored as a single-precision (4-byte) floating-point value.

Can image dimensions be stored in SQL Server 2025?

The short answer for storing image dimensions in SQL Server is that it is not possible to store image dimensions without reducing the number of dimensions. There are techniques to reduce the dimensions with various pay offs in quality. We shall discuss them in a later post using a programming language such as python with the use of certain libraries.

Going forward in populating vector data type into the server the SQL Server Integration services can be used to preprocess the image data and then populate the database. This will also be for a future post.


If you are looking for working with databases, stay in and learn from over 15 years of blogging on databases here.  http://hodentekMSSS.blogspot.com

You may also have a look at my database related books:



Wednesday, February 19, 2025

SQL Server Management Studio: A latest version for SQL Server 2022

The most preferred tool to manage SQL Server 2022. A well integrated tool that has grown over the years for probing, developing and montoring SQL Server. 

This is the latest version of SQL Server Management Studio [build no:20.2.30.0, released July 9,2024]. Note: it is not an upgrade to SQL Server 19.x

  • SQL Server Management Studio (SSMS) is an integrated environment for managing any SQL infrastructure, from SQL Server to Azure SQL Database. 
  • SSMS provides tools to configure, monitor, and administer instances of SQL Server and databases. 
  • Use SSMS to deploy, monitor, and upgrade the data-tier components used by your applications and build queries and scripts.

You may download the executable from this link:

https://learn.microsoft.com/en-us/sql/ssms/release-notes-ssms?view=sql-server-ver16

You will find the following (SSMS-ENU) in your download:


You can doble-click the application to start installing. It takes a very short time to install as shown in these screenshots:


Click Install and installation begins.


These are some new features of the SQL Server Management Studio (from the Microsoft documentation).


Connecting to an existing SQL Server 2022:

Kindly follow the links for installing the SQL Server 2022:



If your SSMS 20.2 installation is successful you should be seeing in the Windows Control Panel  several additional components to ensure a smooth and comprehensive experience in using SQL Server Management Studio:

  • Microsoft Visual Studio Tools for Applications 2019: This is necessary for certain features within SSMS that rely on Visual Studio's development environment.
  • SSMS 20.2: The main application for managing SQL Server instances.
  • Microsoft Help Viewer: Provides access to documentation and help files within SSMS.
  • Microsoft OneDrive: This might have been included to facilitate cloud storage and synchronization of your files.
The SSMS20.2 installation also adds the launch program for the SSMS that you can find in the Search as shown here:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server Tools.

This folder has the following files: 

Shortcut to the SSMS 20.2 launch
Shortcut to Analysis Services Deployment Wizard 20
Performance tools folder

You can doble click to launch from this location or on the Search results:


The SSMS 20.2 above when clicked launches the application and the SSMS user interface is displayed as shown:


Although the program connects to the installed version of SQL Server it is looking for a trusted connection by way of a certificate. There is a check box below Encryption (that has three options) shown above.

If you do not check this box and try to connect you get the following exception:



If you do place a checm mark saying you trust and then connect you get the following display:


This connection is now OK and the SSMS is OPEN FOR BUSINESS!!!

If you are looking for working with databases, stay in and learn from over 15 years of blogging on databases here.  http://hodentekMSSS.blogspot.com

You may also have a look at my database related books:






 




 








Monday, February 17, 2025

Get ready to develop with SQL Server 2025

  I have not yet done looking at SQL Server 2022, SQL Server 2025 is ready to go. Microsoft is indeed relentless! 

Microsoft announced SQL Server 2025 at the Microsoft Ignite event in Chicago. Now , AI spans all over the Microsoft Eco system and that includes SQL Server. This time around Microsoft introduced SQL Server 2025 and SQL database on Fabric.


SQL Server is integrated with AI with:

  • Vector search
  • Vector Indexing using DiskANN
  • T-SqL functions to support generation embedding and text chunking

Another useful feature added is the support for calling external REST APIs into SQL Server, a feature that existed in AZURE SQL Database. This AI feature makes it easy to store your AI models on premises and use them right away.

SQL Server 2025 will have optimized locking and will support native JSON datatype and improvements to Always on Availability groups. Also,GIT support for Microsoft Management Studio was announced. With this SSMS has now what is called a dark mode! 

Furthermore, a new product was announced, the SQL Database on Fabric. Microsoft Fabric is its unified analytics platform that integrates various datatools under one title. It is supposed to simplify data analysis and insights for both professionals and business users. 

Hey, Google does not have one such thing under a single title, but it has various functionalities dispersed in its cloud.

Let's move on!

More here:

https://www.microsoft.com/en-us/sql-server/blog/2024/11/19/announcing-microsoft-sql-server-2025-apply-for-the-preview-for-the-enterprise-ai-ready-database/

Vector Search

It is an incredibly useful tool. The reasons are listed here:

  • It understands meaning, not just keywords: Unlike traditional search that relies on exact matches, vector search understands the semantic meaning and context of your query. This means you get more relevant results, even if you don't use the "right" words.   
  • Handles diverse data types: Vector search isn't limited to text. It can work with images, audio, and even video, allowing you to search across different types of data.   
  • Scales well: Vector search is designed to handle massive datasets, making it ideal for applications dealing with large amounts of information.   
  • Powers advanced applications: Vector search is a key component in recommendation systems, anomaly detection, and semantic search, driving many of the online services we use daily.




Monday, February 03, 2025

Iconic Monkeypod Tree Being Felled Despite Resident Opposition

 The iconic monkeypod tree, a beloved landmark for many in the community, is currently being felled by a contracted crew ( Tree of Hawaii Inc.) despite opposition from some board members. This ongoing operation has left many residents feeling blindsided and frustrated by the homeowners' association (HOA)'s lack of transparency.

Here are links to previous posts on efforts at saving the tree:

https://hodentek.blogspot.com/2024/10/it-was-sad-day-at-3138-waialae-avenue.html

https://hodentek.blogspot.com/2024/09/if-community-is-strong-and-connected-we.html

https://hodentek.blogspot.com/2024/08/if-manoa-could-save-their-trees-so.html

https://hodentek.blogspot.com/2024/07/save-regency-parks-trees-honolulu.html

Neither the condominium owners nor the car owners who parked beneath the tree were informed beforehand of the impending removal, specifically the exact date and time of the operation. This lack of communication, coupled with the history of past disputes over tree removal within the community, has led to exclamations of  "sneaky, underhanded, etc." operation.

Furthermore, residents question whether the condominium management company was aware of the planned removal and, if so, why they failed to inform the unit owners. This raises concerns about the communication channels and decision-making processes within the HOA.

Here are pictures and video of the tree removal:


There is a clear evidence that this region of the Chaminade area is the breeding ground of the Fairy Terns. Zoom in on the blue ribbon.



\

Watch this video:



Status at 1:30 P.M.

The work had stopped and this is a picture of how it is now.




I asked the office manager who was walking near the tree, if the work will continue next day. He said yes.  I wish the manager is wrong. Only tomorrow can tell.



Thursday, January 30, 2025

Very important where you save your SQL Server Installation media files

  This is a very important question. when I began using SQL Server for writing as well as for teaching, I used to take this for granted and used to store at the default location. Sometimes, I used to get into difficulty accessing the installation media as it was needed after a long interval and I would have made changes to my directory structure, or moved them to other places. However, it is very important where you save your SQL Server Installation media for a couple of reasons.

What's the need to save?

1. It provides a means for you to reinstall or repair your installation. You cannot do this task, if you do not have your installation media. 

2. For Off-line installations, it is essential to have this media.

3. If you are having multiple installations, it ensures consistency. I used to have this media on a memory stick and have all my students install on their work stations.

What are suitable locations to save the media?

There are couple of options. Choose one that best suits your needs.

1. Local Drive: When you start installing you will find out how much space is needed on your computer's local drive. At a minimum, you need 6 GB of disc space for the custom installation with most options. If you include all extras it is about 8GB. In order to work comfortably, it can be about 10GB depending on the databases you are considering. Herein, some sample databases are assumed. The installation process brings up the space requirements during installation. 

2. On a Network share. I could have set it up on the network share for my students, but I decided to give them a copy, if they wanted to play with it when not connected to the network.

3. If installation is on a virtual machine, an ISO would be suitable.

4. Mapped drive is another option.

5. On the Cloud: Cloud storage is yet another option. However, there may be cost in storage and data transfer involved. Latency is yet another factor to consider. Internet availability is most essential during the installation process.

The installation media folder can have any name of your choice. I usually accept the default name.

The SQL Server 2022 installation center's Option node is where you specify location of the media during installation.

I originally saved this media (SQL2022-SSEI-Dev.exe, 4191 KB) on my Download folder of the local drive.

On this blog (http://hodentekMSSS.blogspot.com), dedicated to SQL Servers you will find installation of SQL Server from SQL Server 2012 onwards. Even earlier ones are on my other blog, http://hodentek.blogspot.com


Tuesday, January 28, 2025

DeepSeek, How much tech is packed in?

  The emergence of DeepSeek AI, a powerful Chinese language model, has sent shockwaves through the US AI industry. Developed with a focus on cost-effectiveness, DeepSeek reportedly functions effectively on lower-end hardware, a stark contrast to US models heavily reliant on high-end chips like Nvidia's. This revelation triggered a significant sell-off in Nvidia stock, highlighting the potential disruption to the current AI landscape.   

https://site.financialmodelingprep.com/market-news/nasdaq-futures-plunge-amidst-concerns-over-deepseeks-impact-on-ai-chip-demand

Last night, I downloaded DeepSeek to take a peek and lo and behold, at first sight, looked as good as the Copilot, Gemini AI, and others I have come across.

Well, what does it lack?

 However, a notable limitation became apparent: DeepSeek lacks robust image generation capabilities. While it can provide code snippets (like Python with Kivy) to generate images, this approach is less user-friendly and may be hindered by the limitations of lower-end hardware in processing and rendering graphics. In contrast, US models excel in not only creating images but also seamlessly modifying them based on simple text prompts.   This is clearly beyond low-end chips.

This development necessitates a renewed focus on innovation and optimization within the US AI sector. US developers must prioritize improving model efficiency and exploring alternative hardware solutions to maintain a competitive edge. While DeepSeek presents a significant challenge, it also serves as a valuable catalyst for further advancements in AI technology.

Any other disquieting news?

DeepSeek did not do so well in "misguided attention evaluation" and performed answering only 22% prompts in 13 test questions. Here is a comparative test using others at the Github site ( https://github.com/cpldcpu/MisguidedAttention/tree/main/eval#readme):



Read more here: 

Thursday, January 23, 2025

Slowing down a GIF has merits

 

GIFs are very engaging and dynamic images and they can run at a speed set at the time of creation. Well, some GIFs may look way better when run at a slow speed. 

You can use Python code to slow down a GIF that is too fast for your liking. In the previous post, you learnt how to make a GIF from scratch using Python. In this post, you will use Python code to slow down a GIF. The post shows an example.

Here is a GIF that is somewhat fast. It is copied from a website. 

Now here is the Python code that you can use to slow it down. The code shown is copied from my PyCharm user interface. If you copy and paste make sure the indentation requirements are satisfied.

from PIL import Image, ImageSequence
# Open the original GIF gif_path = 'lawn-time-lapse.gif'
gif = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images\lawn-time-lapse.gif')
# Create a list to hold the frames
frames = []
# Loop through each frame in the original GIF
for frame in ImageSequence.Iterator(gif):
# Append each frame to the list
frames.append(frame.copy())
# Save the frames as a new GIF with a slower speed
frames[0].save('slowed_down_1_gif.gif', save_all=True, append_images=frames[1:],
duration=200, loop=0)
print('Slowed down GIF saved as slowed_down_1_gif.gif')

The fast GIF is in the project folder in the path shown. The ImageSequence is the key. You get a sequence of images in the frame that you append to a list. Save the frames as a new GIF with a slower speed. Duration in PIL is absolute in milliseconds.

The code before the print saves the first frame(frames[0]) and it saves all the frames slowing down to a duration of 200 seconds and appends the rest of the frames starting from frame[1], the second frame in the sequence.

Here is the result of slowing down the original GIF.


Since we have a handle to the sequence, we can find the original frames and the original duration as well.


Do you know how to create a GIF?

   You have seen a GIF image and enjoyed it. But have you created one.? There are software programs to create GIFs and perhaps many online sites help creating GIFs.  Here is one for example, https://www.canva.com/create/gif-maker/. Animation akin to GIFS can also be created using javascript although there may not be resulting image with a .gif extension.

GIFs are like very small duration video clips but they are really a composite of many small images flipped rapidly, in-situ to create the illusion of motion. They are made to impress you by their motion.

Why GIFS?

Imagine bringing life to a still photo of a sunset by animating the clouds. An image may be worth a thousand words, but a GIF is worth a thousand images. It adds dynamic movement to static images, unleashing your creativity. If you're active on social media, GIFs are an invaluable tool for self-expression, offering endless possibilities. They bring humor, emotion, and laughter to any page, transforming a collection of static images into a vibrant and engaging experience. With GIFs, you can elevate your storytelling to new heights!"

Here is a simple GIF image copied from a web site  (display gif on web browser - Search):


Ins and outs of using Python to create GIFs:

GIF images have the .gif extension which stands for Graphics Interchange Format. 

In this post, I show you how to create from scratch a GIF using Python. Python uses a image library such as PIL to get the images into the program such as PyCharm. Once they are in the program, you need to use another library to do the flipping action. This library is called imageio, image input/output program. For GIFs this program takes in the images (a number of them) and then it customizes the duration each image is shown; whether the gif repeats itself and how many times it does, etc. Note: if you are new to PyCharm, read up my other Python/Image related posts in this blog, http://hodentekhelp.blogpost.com.

The program presented here also goes through the indexing of the images (as there are many images) which necessitate calling yet another useful library called NumPy. The imageio program cannot accept a image list, but a Numpy list and hence the use of the NumPy library.

In order to create a gif file in a python program, you need the following:

1. A set of images. 

2. Importing libraries PIL, ImageIO and Numpy.

Here is are some five image files I am using in the program:






These are not the best, but enough for the purpose.

Here is the python program that creates a GIF image taking in the images shown here:

----------------------------

BirdsGIF.py

-----------------

# Import libraries used to create a GIF image

import imageio

import numpy as np

from PIL import Image

from PIL.ImageFile import ImageFile

# Load images

image1: ImageFile = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images_3\Bird1.jpg')

image2 = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images_3\Bird2.jpg')

image3 = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images_3\Bird3.jpg')

image4 = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images_3\Bird4.jpg')

image5 = Image.open(r'C:\Users\hoden\PycharmProjects\exploreImage\Images_3\Bird5.jpg')

# Resize images (optional)

image1 = image1.resize((200, 200))

image2 = image2.resize((200, 200))

image3 = image3.resize((200,200))

image4 = image4.resize((200,200))

image5 = image5.resize((200,200))

# Create list of images

images = [image1, image2, image3, image4, image5]

# Convert PIL image  list to NumPy arrays

images = [np.array(img) for img in images]

# Create the GIF using the image list

imageio.mimsave('my_animation.gif', images, duration=2000.0, loop=5)

----------------------

The above program creates a image file with .gif extension and images show for 2000 milliseconds and the GIF image runs five times in succession. If you have time elapsed stills of any event you can easily turn it into an amazingly dynamic image.

That is all there is to creating a GIF. If your images are made with care and are of good quality you can indeed create a good GIF.

The GIf file created, my_animation.gif can be seen in Photo app on your windows computer device, however you can just drag and drop the image on a browser should also work.


Mahalo for staying with me. 

p.s: For these holidays, you can create your greeting card with a GIF. Try it!





Installing the latest version of SQL Server

 Download the latest version of SQL Server from here.


There are a couple of download options as you can see on this page from the above link.


If you are a developer, the best option is the Developer version which provides:

  • Full featured free edition
  • Licensed for use as a development and test database
  • It is for non-production use

However, most purposes the SQL Server 2022 Express is adequate. It provides:

  • Free edition of SQL Server
  • Good fit for desktop development
  • Best fit for small server applications.

The SQL Server editions may be installed on Windows, Linux and Docker Containers.

In this blog for purposes of demonstration and use, the Developer edition will be installed on a Surface Laptop 5 with the following features.

Windows 11 Pro, Version 23H2, OS build 22631.3593. It has 16GB installed RAM

Downloading the developer edition begins by clicking the Download button in the above screen. In response you download the executable, SQL2022-SSEI-Dev.exe (4191 KB)file. This file gets displayed as shown.


If you want a quick installation use the BASIC option. 

In blog the Custom option will be used. If you want to differ to another time, you may just download the installation files by choosing Download Media.

Read the details of the SQL Server 2022 Installation Center



Monday, January 20, 2025

Do you need SQLOISIM for SQL Server?

 SQLIOSIM is a tool for simulating SQL Server IO. SQLIOSIM performs reliability and integrity tests on the disk systems that SQL Server utilizes for data and log files. 

It simulates,

Read

Write

Checkpoint

Backup

Sort and 

Read-ahead activities of MS SQL Server.

Main objective of SQLIOSIM is to test the reliability of the underlying I/O subsystem even before installing SQL Server. This proactive tool helps preparing well for the installation. SQL Server installation is not needed for using it as it does not interact with the SQL Server. If an installation exists, using it may overwrite the files. It is not a tool for data security. It is an upgrade over the previous SQ7IOStress utility.

It is located in the Program Files/Microsoft SQL Server/MSSql16.<Named Instance>MSSQL/BINN folder of your installation.

In the installation described here, there are two SQLIOSIM related files in the BINN folder.

SQLIOSIM Application (SqLIOSIM.exe)----GUI

SQLIOSIM DOS file (SQLIOSIM.com)--DOS 

For using SQLIOSIM.com you need to configure the SQLIOSIM configuration file.


What if you cannot locate the file?

If the file is not found as in this installation, it can be found in GitHub. However, if it is not found on the GitHub and one may need to go to Microsoft or raise the issue. As we see later, there may be a way out using the GUI.


https://github.com/microsoft/mssql-support/blame/master/sqliosim/Readme.md


The SQLIOSIM gui can be launched using the SQLIOSIM.exe application in the BINN folder.

Double click the SQLIOSIM application in the BINN folder to launch the GUI.


Click SIMULATOR to open the Simulator. Simulator->Configure will open the Files and Configuration GUI as shown.

From here on it can be used to configure the .mdx and .ldx file locations, size  and max size and Increment parameters on the computer and test patterns for integrity testing can be carried out. Do not choose the existing .mdx and .ldx file locations as they will be overwritten during testing.


Thursday, January 16, 2025

Do you want to custom Install SQL Server 2022?

 SQL Server is a comprehensive software that works with a variety of Microsoft Software such as Reporting Services, EXCEL, 


It is assumed that you are coming here from the following link:

On executing SQL2022-SSEI-Dev.exe (4191 KB)file. This file gets displayed as shown.

Choose Custom edition.

Accept the target location, you may also choose. Clicking Install downloads the installation package.


  Installation begins.


SQL Server Installation Center opens as shown.

 Invest some time in going through this screen before proceeding further.

These are the detailed screens you encounter:

Planning



Installation


Maintenance


Tools

Resources 

Advanced   


Options

The installation center guides you through the process, step by step till you arrive at finishing the installation.

Here is a detailed description of installing SQL Server 2016 Developer Edition

used this installation in writing my books on SQL Server products.



DMCA.com Protection Status