Sql-Server

SQL: Understanding Cache Dependencies in ASP.NET

SQL: Understanding Cache Dependencies in ASP.NET

I’ve had a number of clients over the years who were wondering how the SQL dependencies in ASP.NET evolved, and what they were used for. I’ve updated a previous blog post about this below.

Traditional ASP Applications

In traditional ASP applications, every time the user would request a page, the application would retrieve the data from the database to render the page. Clearly this doesn’t scale very well. It works for a small number of users but not a large number. Often though, this data access can be completely avoided for certain types of data.

2026-03-03

Echoes from the field 10 - What's in a name?

Echoes from the field 10 - What's in a name?

I always say that one of the things that I love about consulting or mentoring work is that I see things (mostly code) that I would have never have thought of.

Sometimes, it’s good information where I learn a new technique that I hadn’t considered. But most times, it’s just something weird that a client has done.

GUID Table Names

A good example of this was a site where every table had a GUID name. Yes, I’m talking about tables with names like:

2026-03-01

Mixing UNION and UNION ALL Operations

Mixing UNION and UNION ALL Operations

Recently, I saw a subtle coding issue related to the UNION operator. With SQL Server, the UNION operator combines two rowsets into a single rowset. If UNION ALL is used then all rows are returned. With just UNION without the ALL, only distinct rows are returned. All good so far.

One of the most common performance issues that I come across is where people have just used UNION where they should have used UNION ALL. That extra distinct operation is often not needed, yet often very expensive.

2026-02-27

SQL: New Using AI Features in SQL Server 2025 course released

SQL: New Using AI Features in SQL Server 2025 course released

Do you want to start working with AI-related features in SQL Server 2025?

Our new course might be just what you need:

https://sqldownunder.com/courses/aif_modules

As these features are relatively new, the focus of this course is on design and architecture decisions that remain valid, even as individual features, syntax, and external AI services evolve. It does not aim to turn SQL Server into an AI platform, nor does it attempt to teach model training, data science, or vendor-specific AI tooling.

2026-02-25

SQL: Avoiding connection timeouts on first connection to LocalDB edition of SQL Server Express

SQL: Avoiding connection timeouts on first connection to LocalDB edition of SQL Server Express

When you first make a connection to the new LocalDB edition of SQL Server Express, the system files, etc. that are required for a new version are spun up. (The system files such as the master database files, etc. end up in:

C:\\Users\\<username>\\AppData\\Local\\Microsoft\\Microsoft SQL Server Local DB\\Instances\\LocalDBApp1) 

Now that can take a while on a slower machine, so this means that the default connection timeout of 30 seconds that you’ll find in most client libraries, could well be exceeded.

2026-02-23

SDU Tools: Version 27 is now released for download

SDU Tools: Version 27 is now released for download

Version 27 of our free SDU Tools for developers and DBAs is now released and winging their way out to our SDU Insiders.

You can find details on the tools here .

If you haven’t been using SDU Tools yet, I’d suggest downloading them and taking a look. At the very least, it can help when you’re trying to work out how to code something in T-SQL.

Along with the normal updates to SQL Server versions and builds, we’ve added the following new tools:

2026-02-19

SQL: DCL clauses in CREATE SCHEMA

SQL: DCL clauses in CREATE SCHEMA

Most people seem to be unaware that a CREATE SCHEMA statement can also include other DDL or DCL within it.

I’ve never been very keen on the option to add additional clauses in the CREATE SCHEMA statement as I’ve seen lots of issues when scripts are executed manually. You get a different outcome, depending upon how you execute it. For example, if you run statements in this script:

CREATE SCHEMA SomeSchema AUTHORIZATION Someone

CREATE TABLE Blah (Some table definition);

Where does the table Blah get created? Well, it depends.

2026-02-15

SQL: UPDATE against a table-valued function when declared inline

SQL: UPDATE against a table-valued function when declared inline

I had a discussion with a friend the other day who wouldn’t believe me that T-SQL allowed an UPDATE operation to be executed against a function in some situations. I must admit that when I first heard about it, it did my head in a bit as well, at least based on all I thought I knew about programming languages in general.

You can only perform an UPDATE against a table-valued function in T-SQL when the function was declared as an inline TVF. It still feels to me like it shouldn’t ever be permitted, but if you want to try it, here’s an example:

2026-02-13

SQL Down Under show 94 with guest Ben Weissman discussing vectors, REST, and AI in SQL Server 2025

SQL Down Under show 94 with guest Ben Weissman discussing vectors, REST, and AI in SQL Server 2025

It was great to catch up with Ben Weissman today and to have him on a SQL Down Under podcast.

Ben is a fellow Data Platform MVP.

Ben focusses on datawarehousing and analytics, still with a lot of on premises work but of course also Fabric / Azure work.

He has long experience with SQL Server, having started with SQL Server 6.5.

Ben says he loves to travel and loves food. He’s an author of books and video courses, and the organizer of data related events like Data Grillen, New Stars of Data, SQL Konferenz, and Data Saturday in both Vienna and Germany and other locations.

2026-02-11

SQL: Log Shipping Between SQL Server Versions

SQL: Log Shipping Between SQL Server Versions

One of the discussion lists that I participate in, had a brief discussion the other day about whether or not it’s possible to perform log shipping between differernt versions of SQL Server.

Specifically, can you do log shipping between SQL Server 2017 and SQL Server 2025?

Partial success

SQL Server does support restoring earlier version databases on later versions of the product. The databases get upgraded along the way when you perform restores of databases. SQL Server also allows you to restore transactions logs from earlier versions of the product but the upgrade doesn’t happen until recovery of the database occurs. And that’s why you can’t use STANDBY mode in this situation.

2026-02-09