FIND YOUR NEXT FEW LINES

Results for “CMD”

Small, practical examples. Search by task or narrow things down below.

254 snippets foundClear filters
PowerShellGetting Started

Assign a value to a variable

PowerShell: Assign a value to a variable using PowerShell 7.

PowerShell✓ Tested
SQL ServerSubqueries & ranked selection

Attach an overall count to every row

SQL Server: An uncorrelated scalar subquery supplies the same aggregate to each output row.

SQL Server✓ Tested
SQL ServerConstraints & defaults

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
PowerShellArray operations

Build a mutable generic list

PowerShell: A generic list supports repeated additions without copying an entire array each time.

PowerShell✓ Tested
PowerShellFiles & paths

Build a portable file path

Combine directory and filename using the platform separator.

Join-Path✓ Tested
SQL ServerSubqueries & ranked selection

Build a query from several named stages

SQL Server: Separate row selection from aggregation using two common table expressions.

SQL Server✓ Tested
SQL ServerWindow analytics

Calculate a cumulative integer percentage

SQL Server: Divide a running window sum by the complete total using a unique ordering key.

SQL Server✓ Tested
PowerShellFile operations & integrity

Calculate a file’s SHA-256 digest

PowerShell: Get-FileHash hashes bytes without requiring the caller to load the whole file.

PowerShell✓ Tested
PowerShellGetting Started

Calculate a simple total

PowerShell: Calculate a simple total using PowerShell 7.

PowerShell✓ Tested
SQL ServerGetting Started

Calculate a total for each group

SQL Server: Group nonmissing categories and calculate separate totals.

SQL Server✓ Tested
SQL ServerGetting Started

Calculate a value with SELECT

SQL Server: Evaluate a small arithmetic expression on the database server.

SQL Server✓ Tested
SQL ServerReporting & grouped calculations

Calculate each group’s integer percentage of the total

SQL Server: Multiply before division and protect against a zero denominator.

SQL Server✓ Tested