Skip to content

Instantly share code, notes, and snippets.

View jasonhorner's full-sized avatar
🌴
On vacation

Jason Horner jasonhorner

🌴
On vacation
View GitHub Profile
@jasonhorner
jasonhorner / database-metadata-metrics
Last active February 15, 2024 17:16
SQL Server metadata query with column info
with schema_info
as (SELECT t.table_catalog
, t.table_schema
, t.table_name
, (
SELECT
c.column_name,
c.ordinal_position,
CASE
WHEN c.DATA_TYPE IN ('varchar', 'char', 'varbinary', 'binary') THEN
@jasonhorner
jasonhorner / AzureSqlMonitoring.md
Last active October 2, 2021 19:28
Resources for my Azure SQL Monitoring Talk

Azure SQL Monitoring Resources

This page has the resources for my Azure SQL Monitoring Talk

Abstract

Migrating you on-premises Database to Azure SQL DB was easy but now comes the hard part how do you setup monitoring and alerts? While there are many 3rd party options, let's have a look at what comes standard with Azure:

  • Using Azure Log Analytics to monitor databases
  • How can you be sure your azure SQL Database isn't under or over allocated, so that your costs are optimized.
  • How can you project what future costs may be.
@jasonhorner
jasonhorner / sql_table_metadata.sql
Created August 16, 2021 17:31 — forked from OsirisDBA/sql_table_metadata.sql
SQL Server Table Metadata
DECLARE @SchemaName sysname = ''
, @TableName sysname = '';
WITH pk /* Primary Keys */
AS ( SELECT t.object_id
, pkc.column_id
, ic.index_column_id pk_index
, pk.name AS pk_name
FROM sys.tables t
JOIN sys.schemas s ON s.schema_id = t.schema_id
@jasonhorner
jasonhorner / sql_table_metadata.sql
Created August 16, 2021 17:31 — forked from OsirisDBA/sql_table_metadata.sql
SQL Server Table Metadata
DECLARE @SchemaName sysname = ''
, @TableName sysname = '';
WITH pk /* Primary Keys */
AS ( SELECT t.object_id
, pkc.column_id
, ic.index_column_id pk_index
, pk.name AS pk_name
FROM sys.tables t
JOIN sys.schemas s ON s.schema_id = t.schema_id
@jasonhorner
jasonhorner / sql_table_metadata.sql
Created August 16, 2021 17:31 — forked from OsirisDBA/sql_table_metadata.sql
SQL Server Table Metadata
DECLARE @SchemaName sysname = ''
, @TableName sysname = '';
WITH pk /* Primary Keys */
AS ( SELECT t.object_id
, pkc.column_id
, ic.index_column_id pk_index
, pk.name AS pk_name
FROM sys.tables t
JOIN sys.schemas s ON s.schema_id = t.schema_id
@jasonhorner
jasonhorner / settings.json
Created February 9, 2021 19:33
Windows Terminal Settings File
// This file was initially generated by Windows Terminal 1.3.2651.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@jasonhorner
jasonhorner / workstation.ps1
Last active June 3, 2022 08:25
chocolatey scripts for workstation setup
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey -y
choco install git.install -y
choco install git-credential-manager-for-windows -y
choco install github -y
choco install gh -y
#@choco install git-fork -y
@jasonhorner
jasonhorner / test.ipynb
Created November 22, 2020 16:32
Gist sample notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.