Parameterized Scripts in SSMS

If you’ve ever used the Template Explorer Ctrl+Alt+T in SQL Server Management Studio (SSMS), then you may already be familiar with the concept of parameterized in SSMS. You can use Ctrl+Shift+M to replace parameterized values in the template with your own values. You can also create your own parameterized values in SQL scripts that you may have. The parameters are enclosed in angle brackets and have three values like so.

Windows 10 Startup Folder

Windows 10 has two types of startup folders, one for all users and one for each individual user. There are a number of ways to access the folders. The following are how I tend to access them, but I do it infrequently enough that I usually have to look it up so I’m creating that resource for my easy reference now. The all users startup folder can be found here:

PowerShell measure command duration

There are times when you want to measure how long some piece of code takes to execute or compare it to another piece of code to decide if one is faster than the other. There are plenty of options for measuring how long a command takes to execute. Here I’ll show an example in PowerShell using the Measure-Command cmdlet. 1 2 $duration = Measure-Command -Expression { $result = Get-ChildItem -Path "$env:userprofile\Documents\*.

SQL Server Load Image From File

Every once in a while I find myself needing to load an image file into a database field. Assume there is a table similar to this and I already have one or more widget records. 1 2 3 4 5 6 7 8 9 10 11 create table dbo.Widget ( WidgetId tinyint not null primary key, WidgetName varchar(40) not null, WidgetDrawing varbinary(max) null ); insert into dbo.Widget (WidgetId, WidgetName) values (1, 'Widget A'), (2, 'Widget B'), (3, 'Widget C'); Now I have a drawing of one of those widgets which I would like to load into the WidgetDrawing column.