Press "Enter" to skip to content

Curated SQL Posts

Hosting an Local Embedding Service for SQL Server 2025

Greg Low has a demo:

Instead of working directly with text, images, or other rich content, an embedding represents that content as a set of numbers that capture semantic relationships learned by a model. This lets systems work with meaning in a mathematical way rather than relying on concepts like text matching.

Embeddings are the output of trained text-based AI models. One possibly surprising concept is that they’re used for similarity, as opposed to facts – and for relative closeness instead of exact matches.

SQL Server is not designed to host or execute those models. This isn’t a limitation; it is a design choice. While it would be possible to run code within SQL Server to generate embeddings, it just wouldn’t be a good idea.

Note that SQL Server can already run machine learning models directly, and use the PREDICT statement to make predictions. We don’t want to be doing that with the language models we need for embeddings, though.

There are also some really good local embedding models, and between that and the vector similarity functionality in SQL Server, you can perform semantic search without needing to reach out to an online service.

Leave a Comment

Choosing between ORMs vs Raw SQL

Jamal Hansen embraces the power of “and”:

At the beginning of this series, I promised that even if you know how to use an Object Relational Mapper (ORM) to interact with a database, knowing SQL would make you a better developer. Now that we have covered everything from SELECT to parameterized queries, it is time to answer the question that every Python developer eventually asks: when should I use an ORM, and when should I just write SQL?

I think there’s a reasonable split between the two, though the choice of ORM matters a lot as well. The heavier the ORM (nHibernate and Entity Framework, I’m looking at you), the more performance you’re trading off. By contrast, a micro-ORM like Dapper has a much slimmer profile, and if you combine that with judicious use of stored procedures for non-trivial work, the outcome is usually good.

Leave a Comment

Removing Filters from the Filter Context in DAX

Marco Russo and Alberto Ferrari compare a few techniques:

Computing values in DAX is all about understanding how to manipulate the filter context to obtain the desired output. DAX offers a wide variety of functions to manipulate the filter context, including a rich set designed to remove filters. Among the many, four are used the most: ALLALLSELECTEDALLEXCEPT, and REMOVEFILTERS. Choosing the right one can be tough.

In this article, we do not want to dive into too many details; the goal is to let our readers understand when to use which function. Whenever needed, we provide links to deepen your knowledge about specific topics. Make sure to read the additional content if you want to know more about some specific behaviors.

Click through for demonstrations and a contrast of these different techniques.

Leave a Comment

GraphQL Deployment Error due to dm_exec_describe_first_result_set()

Koen Verbeeck troubleshoots an issue:

A while ago we suddenly had an error while trying to deploy one Fabric workspace to another using fabric-cicd. The issue was with a GraphQL object and the following error was returned:

Failed to publish GraphQLApi ‘my_graphql’: Operation failed. Error Code: DatasourceInvalidStoredProcedure. Error Message: Only those stored procedures whose metadata for the first result set described by sys.dm_exec_describe_first_result_set are supported.

Read on for Koen’s diagnosis and resolution for this issue.

Leave a Comment

Tabular Editor CLI Preview Available

Ruben Van de Voorde makes an announcement:

We are happy to launch the Limited Public Preview of the Tabular Editor CLI, a cross-platform command-line interface that gives humans, AI agents, and CI/CD pipelines headless access to Tabular Editor features. In practice, that means driving Tabular Editor by typing commands instead of clicking through the app. That may sound like extra work for a one-off edit, and it is. The payoff comes when the task repeats: a command is text, so you can save it, version it, and run it again later or unattended, while a click in a dialog does the job once and is gone. Whether you want to script bulk edits across dozens of models, let a coding agent work on your semantic model directly, or automate deployments in your build pipeline: the TE CLI is built for it, on Windows, macOS, and Linux.

This will be free until the end of September, after which point you’d need a Tabular Editor 3 license to continue using it.

Leave a Comment

Recovering Deleted Items in Microsoft Fabric

Reitse Eskens hits the recycle bin:

Let’s be honest: how many times have you accidentally deleted something? Either on your laptop, in a database or in a SaaS product.
It happens. We’re all humans (unless you allow agents to do all your work for you), and mistakes happen.

Until recently, when you deleted an item in Fabric, it was gone. Poof. Done. No grace period.

And that was a bit scary, to be honest, but now we have a new option to help us recover from oopsies!

The answer to Reitse’s question is “far too often for me to want to admit out loud.”

Leave a Comment

Data Agent Prompt Handling and Semantic Models

Marc Lelijveld digs into Microsoft Fabric Data Agents:

What makes Fabric Data Agents particularly interesting is the wide range of supported data sources. Today, Data Agents can connect to nearly everything that lives inside Microsoft Fabric, or data that is linked into Fabric through shortcuts. Whether your data sits in a Lakehouse, Warehouse, KQL Database, Power BI semantic model, or even external storage connected through OneLake shortcuts.

However, the way Data Agents handle sources can differ significantly from one source type to another. Semantic Models in particular behave quite differently compared to other Fabric data sources. In this blog, I’ll dive deeper into how prompt handling works for Semantic Models, what happens behind the scenes, and the common gotchas you’re likely to encounter along the way.

Read on to see how semantic model behavior differs in particular from SQL or DAX queries.

Leave a Comment

Partitioned Compute with Fabric Dataflows Gen2

Chris Webb continues to test out Fabric Dataflow Gen2 performance:

In the first part of this series I showed how the Concurrency setting in a Fabric Dataflows Gen2 can affect refresh performance when there are multiple queries inside the dataflow. In this post I will show how, with Partitioned Compute, this setting can also affect the performance of a single query within a dataflow.

To test this I created a dataflow with one query, a modified version of the query that I used in this post from earlier this year which returns a table with ten rows and calls a function with a built-in delay of 60 seconds on each row.

This is a preview feature but Chris shows a simple but effective test to demonstrate how this capability works.

Leave a Comment

WinGet and Path Not Updating

Justin Bird ran into some trouble:

Whilst I predominantly use MacOS, I do have to run a Windows VM for certain apps (cough Power BI cough). I ran into an issue recently when trying to installing apps on a vanilla Windows 10 build using Winget via the terminal in VS Code.

After installing the app, I found that the PATH environment variable was not updated, which meant I couldn’t run the app from the command line without specifying the full path.

Read on to learn what the issue was and how Justin was able to fix it.

Leave a Comment