Skip to content

Instantly share code, notes, and snippets.

View jzabroski's full-sized avatar
🎯
Focusing

John Zabroski jzabroski

🎯
Focusing
View GitHub Profile
@jzabroski
jzabroski / Create_SQLAgentJobSripts.ps1
Created July 26, 2017 20:09
PS script to generate all SQL Server Agent jobs on the given instance.
# Date: 16/02/14
# Author: John Sansom
# Description: PS script to generate all SQL Server Agent jobs on the given instance.
# The script accepts an input file of server names.
# Version: 1.1
#
# Example Execution: .\Create_SQLAgentJobSripts.ps1 .\ServerNameList.txt
param([String]$ServerListPath)
@jzabroski
jzabroski / TSQL Security Audit Report
Last active April 8, 2024 10:50
TSQL Security Audit Report.
/*
--Script source found at : http://stackoverflow.com/a/7059579/1387418
Security Audit Report
1) List all access provisioned to a sql user or windows user/group directly
2) List all access provisioned to a sql user or windows user/group through a database or application role
3) List all access provisioned to the public role
@jzabroski
jzabroski / Execution-Cache-Single-Use-Plans-Explore.sql
Last active July 18, 2017 12:43 — forked from LitKnd/Execution-Cache-Single-Use-Plans-Explore.sql
TSQL to do a quick and dirty look at single-use plans in the execution plan cache of a SQL Server.
/***********************************************************
TSQL to do a quick and dirty look at single-use plans in
the execution plan cache of a SQL Server.
************************************************************/
/* Size of single use adhoc plans in execution plan cache */
SELECT
objtype,
cacheobjtype,
SUM(size_in_bytes)/1024./1024. as [MB]