Skip to content

Instantly share code, notes, and snippets.

View c0shea's full-sized avatar

Connor O'Shea c0shea

View GitHub Profile
@c0shea
c0shea / CreateExtendedEventSession.sql
Last active May 3, 2024 00:08
Query Exercise: Who’s Changing the Table?
create event session StackOverflow
on server
add event sqlserver.rpc_starting
(
set collect_statement = (1)
action
(
package0.event_sequence,
sqlserver.client_hostname,
sqlserver.database_name,
public static class LoggerExtensions
{
public static void Trace(this Logger logger, Exception exception, LogMessageGenerator messageFunc)
{
if (logger.IsTraceEnabled)
{
if (messageFunc == null)
{
throw new ArgumentNullException("messageFunc");
}
@c0shea
c0shea / DiskUtilization.ps1
Created October 16, 2016 22:29
Gets disk utilization from local and remote machines
[CmdletBinding()]
Param ([Parameter(Mandatory=$False,Position=0)]
[String[]]$ComputerName = "SERVER")
Write-Host ""
# Change these values
$IgnoreSystemReserved = $true
# Percents must be expressed as a decimal value (e.g. 50% is 0.5)
$WarningPercent = 0.15