Little SQL Server Tricks: Use Underline Characters With Like

I needed to find all columns with an underscore (_) in their name and came up with this query:

But instead of showing me columns with a _ in their name, I got every column back that exists in my database. When I replace _ with anything else, I got the expected result. What …

Read more

Little SQL Server Tricks: CREATE OR ALTER Views

With SQL Server 2016 SP1 came a small but helpful new statement to create views: OR ALTER. If you add this to the create script for a view, SQL Server will figure out if it should run the CREATE or the ALTER statement:

This feature is especially helpful when you incrementally develop your views. …

Read more