Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@NJLangley
NJLangley / Get Table Sizes and Row Counts.sql
Last active March 30, 2021 08:57
TSQL Partitioning Scripts
SELECT TOP 20
tables.[name] as table_name,
schemas.[name] as schema_name,
isnull(db_name(dm_db_index_usage_stats.database_id), 'Unknown') as database_name,
sum(allocation_units.total_pages) * 8 as total_space_kb,
cast(round(((sum(allocation_units.total_pages) * 8) / 1024.00), 2) as numeric(36, 2)) as total_space_mb,
sum(allocation_units.used_pages) * 8 as used_space_kb,
cast(round(((sum(allocation_units.used_pages) * 8) / 1024.00), 2) as numeric(36, 2)) as used_space_mb,
(sum(allocation_units.total_pages) - sum(allocation_units.used_pages)) * 8 as unused_space_kb,
cast(round(((sum(allocation_units.total_pages) - sum(allocation_units.used_pages)) * 8) / 1024.00, 2) as numeric(36, 2)) as unused_space_mb,
@NJLangley
NJLangley / multiple_ssh_setting.md
Created March 2, 2021 16:47 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@NJLangley
NJLangley / Associative Grouping using Graph Tables.sql
Last active July 5, 2019 16:02
Associative Grouping using tSQL
IF db_id('demo') IS NULL
CREATE DATABASE demo
GO
USE demo
GO
-- Nodes
DROP TABLE IF EXISTS SupplierNodes;
CREATE TABLE SupplierNodes
@NJLangley
NJLangley / cloudSettings
Last active June 12, 2019 22:53
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-06-12T22:53:20.627Z","extensionVersion":"v3.2.9"}
@NJLangley
NJLangley / profile.ps1
Last active May 16, 2019 20:58
PowerShell Profile
Import-Module posh-git;
# PoshGit settings
$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n'
@NJLangley
NJLangley / ssms_colours_only.vssettings
Created May 13, 2019 16:48
My SSMS Colour Scheme
<UserSettings>
<ApplicationIdentity version="14.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
<Theme Id="{A4D6A176-B948-4B29-8C66-53C97A1ED7D0}"/>
@NJLangley
NJLangley / Signing Stored Procedures for Server Level Permissions Demo Code.sql
Last active October 24, 2017 15:43
Signing Stored Procedures for Server Level Permissions Demo Code
/*********************************************************************************************************************
****
**** Demo script for signing stored procedures with certificates
****
**** Provided as is, run at you on risk, and not on a production server!
****
*********************************************************************************************************************/