Results for “CMD”
Small, practical examples. Search by task or narrow things down below.
Assign a value to a variable
PowerShell: Assign a value to a variable using PowerShell 7.
PowerShell✓ Tested
Attach an overall count to every row
SQL Server: An uncorrelated scalar subquery supplies the same aggregate to each output row.
SQL Server✓ Tested
Block deletion of a referenced parent
SQL Server: The default foreign-key action prevents deletion while a child still refers to the parent.
SQL Server✓ Tested
Build a mutable generic list
PowerShell: A generic list supports repeated additions without copying an entire array each time.
PowerShell✓ Tested
Build a portable file path
Combine directory and filename using the platform separator.
Join-Path✓ Tested
Build a query from several named stages
SQL Server: Separate row selection from aggregation using two common table expressions.
SQL Server✓ Tested
Calculate a cumulative integer percentage
SQL Server: Divide a running window sum by the complete total using a unique ordering key.
SQL Server✓ Tested
Calculate a file’s SHA-256 digest
PowerShell: Get-FileHash hashes bytes without requiring the caller to load the whole file.
PowerShell✓ Tested
Calculate a simple total
PowerShell: Calculate a simple total using PowerShell 7.
PowerShell✓ Tested
Calculate a total for each group
SQL Server: Group nonmissing categories and calculate separate totals.
SQL Server✓ Tested
Calculate a value with SELECT
SQL Server: Evaluate a small arithmetic expression on the database server.
SQL Server✓ Tested
Calculate each group’s integer percentage of the total
SQL Server: Multiply before division and protect against a zero denominator.
SQL Server✓ Tested