01/07/2026

I LIKE it with ESCAPE

Most of you who are in TSQL world like me have used LIKE operator to find strings that not exactly match or find a row which contains a specific word.


For example, if you want to find names that starts with "ST", you would do someting like this in TSQL:

SELECT DisplayName FROM dbo.Users

WHERE DisplayName LIKE 'ST%'

This will bring display names like "Stephen", "Stanley", "Stone" etc.

But recently, I came across neat trick I can use with LIKE operator in TSQL, specially when using wild card charaters.

LIKE operator accept several wild card characters:

  • % matches any string of zero or more characters (this is the most used)
  • _ matches exactly one character
    • LIKE 'ST_' => matches => ST5, STT, ST3, etc (exactly one character after ST)
  • [...] matches any single character in a set or range (like [a-f])
    • LIKE 'ST[a-f]phen => matches => STaphen, STbphe, STcphen, STdphen, STephen, STfphen (characters from a to f)
  • [^...] matches any single character not in a set or range
    • Similar to above, but it is NOT match
When you using wild card characters like this, what if search string contains, wild card characters in it and you want to search fo them?

That is where ESCAPE hint comes handy.

For example let us consider following:

SELECT * FROM Products WHERE ProductCode LIKE '%_DISCONTINUED%';

In here we want to search for product codes, ended with "_DISCONTINUED" E.g. CAT1_DISCOUNTINUED, LOSS_DISCOUNTINUED. In other words we need "_" character (which LIKE operator consider as wild card character) in the search string.

In that scenario, we can change the T-SQL like below:

SELECT * FROM Products WHERE ProductCode LIKE '%\_DISCONTINUED%' ESCAPE '\';

This tells SQL parser, we are using "\" character as escape character and we escaping "_"character and telling LIKE operator to include it in the search.

If we don't use escape character, LIKE "%_DISCOUNTINUED%" will result in results like "ADISCOUNINUED", "IGNOREMEDISCOUNTINUED" which we really don't want.

Now \_ means "a literal underscore," and the query only matches rows where that underscore is actually there. The ESCAPE '\' clause is what tells SQL Server "hey, whenever you see a backslash in this pattern, treat the next character as literal, not special."

You don't always have to use ackslash, by the way — any single character works, as long as it's one you're not otherwise using in the pattern:

SELECT * FROM Products WHERE ProductCode LIKE '%!_DISCONTINUED%' ESCAPE '!';

Above T-SQL also brings same results.

Consider a example you want to find values like 50%.

SELECT * FROM Discounts WHERE Description LIKE '%50\%%' ESCAPE '\';

In above example you can see two % signs together, one sign tells SQL server next character appear need escaping from wild card treatment, there fore looking for 50%.

This setting is per query, andn will not effect all queries you execute after that.

Hope you have learned something new today like me.

Creating Videos for Tutorial using Remotion and Claude AI

I always believe, picture worth thousand words and video worth even more when it comes to do tutorials.

Recently I found a tool called Remotion.




Remotion is a short video generating app which uses React at the core. It is programmatic way to generate videos. Because it is programmatic, it works well with AI agents. This is why it has got my attention.

Therefore, in blog I'm going to show how remotion can be used with Claude.ai.

Since we are going to use Remotion with Claude.Ai, we need Claude code installed on the machine we are intended to use Remotion. Note that Claude code require paid subscription to work.

Another pre-requisite is Node.js. Install the latest Node.js (remotion will require v16 or higher).


Installation

Create a folder for your project and open that folder using terminal.

Type following:

npx create-video@latest

Follow the wizard in terminal.

Wizard will ask you to choose a template, choose the blank template as we ae just getting started and we intend to use this with Claude code.

Wizard will ask you to install TailWindCSS or not. For our beginner project, I would say no. But it is completely optional, choosing yes is also ok, but add more complexity.

Next question is "Add agent skills?". Definitely answer yes for this question.

You will be asked to choose which agent to get skills installed for. For us it is Claude code.

Then you will require to choose installation scope. I would keep it to project. You can choose Global if you prefer to install it once.

Installation method for skill is "Symlink"

Then wizard will install the skills and complete the installation.

Next step is to install all packages. To this run following:

npm i

Once all packages are installed, you can run the app using following command:

npm run dev

There will be nothing as we haven't add any frames.


Setting up Claude Code

Next step is to run Claude code on the projects folder.

Assuming you are still on the project folder in terminal type following to invoke Claude Code:

Claude

Assuming everything is setup correctly on Claude code, above will open Claude code in project folder.

run /init to initialize Claude code for the project. This will read the content of the folder and add the remotion skill and will create claude.md file for the project. Once this is done Claude is ready for your instructions.


Prompt

Now you provide the prompt to Claude code to build the video. More elaborate the prompt is more sophisticate your video will be.

To make this demo easier, I have asked following from Claude.ai (chat box) and create the prompt for me.

Create a prompt which I can give for Claude code to create simple video tutorial for SQL Server Constraint types using "Remotion". This is for remotion project. See remotion information on https://www.remotion.dev/ . SQL server Constraint video should be based on following blog post -> https://mpa-tech-tales.blogspot.com/2026/05/all-constraints-in-sql-server.html . It should have attractive opening screen and then will need several animating screens based on sections of the blog post. For example it should show a one animation screen explaining what are sql server constraints and then transit from that screen to next screen to show primary key constraints and related animations. Can you please generate the prompt for this?

It has created very comprehensive prompt, which I can paste or give Claude Code as a md file.

If the prompt is so big, it is advisable to instruct Code Claude to proceed phase by phase (after validating output of each phase). This will make sure Claude keep on the track we wanted instead of what it wanted.

Here is the first draft of the video created by Claude Code and remotion, using above prompt. It is not any mean polish video I wanted, but you can keep refine it with Claude Code to make it more preferable. 

In my opinion (as per now), Remotion + Claude can create you basic animation videos which you can use for tutorials or presentations. I think more appropriate use case is use it to create short animations which can be embedded/merge into your overall video, rather than making entire video from Remotion + Claude.

Schema Compare in SSMS 22.7.0

One of the coolest features released lately with SSMS (SQL Server Management Studio) is Schema Compare feature, which released on version 22.7.0.

To me it is one of anticipated feature. Yes, I know we had commercial products like Redgate SQL compare, but most organisations I worked with (small to mid size), doesn't have budget to afford that (or don't want to spend money on that).

There fore I had quick look at what it can do.

Currently it can be invoked through "Tools" menu in SSMS.


Worth noting, this feature is still in "Preview" mode, so it is not fully production ready and might not compare all of the database objects.

Schema Compare UI is as follows:


It has two main panes, one in top (showing what it compare) and one in bottom showing differences in objects when selected.

Optoins button give ability customize your comparison. When pressed following dialog box is opened:

Dialog box has two tabs.

  1. General Options
  2. Object types to compare

General options tab give you control over the comparison process and change script generation process. It gives options such as "Ignore ANSI NULL". Object Types to compare tab allows you to select which objects to compare:


You can compare following database types:
  • Databses
  • Databse Projects
  • Data-tier Application Files (dacpac)
As the source you can select any of these.


In my demo I have selected two versions of Stack Overlow database:


Then press "Compare" button.

Comparison takes little while, if you database has thousands of ojects, it will definitely take considerable time. I think this is something they need to focus on before release to production.

Here are the results from comparison:


It shows deleted table in target table -> dbo.LegacyPostVotes. New table in source database -> dbo.Badges. And also shows several changes. If you click on one of these lines, you can see detail view of the change. For example following screenshot shows, what appear when I select db.usp_GetUserById stored procedure, which was changed:


You can include/exclude changes you want or don't want. Then press either "Generate Script" button or "Apply" button. Generate Script button, generates the change script and open in a new Script Window. Apply button directly apply included changes into target database.

In my openion, It is not perfect, but start to walk write direction I would say.

I'm hoping to test this more with future releases and write about it.










I LIKE it with ESCAPE

Most of you who are in TSQL world like me have used LIKE operator to find strings that not exactly match or find a row which contains a spec...