Skip to content

Instantly share code, notes, and snippets.

View Get Table Sizes and Row Counts.sql
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 Mar 2, 2021 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

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"
View Associative Grouping using Graph Tables.sql
IF db_id('demo') IS NULL
CREATE DATABASE demo
GO
USE demo
GO
-- Nodes
DROP TABLE IF EXISTS SupplierNodes;
CREATE TABLE SupplierNodes
@NJLangley
NJLangley / profile.ps1
Last active May 16, 2019
PowerShell Profile
View profile.ps1
Import-Module posh-git;
# PoshGit settings
$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n'
@NJLangley
NJLangley / cloudSettings
Last active Jun 12, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-06-12T22:53:20.627Z","extensionVersion":"v3.2.9"}
View ssms_colours_only.vssettings
<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 Oct 24, 2017
Signing Stored Procedures for Server Level Permissions Demo Code
View Signing Stored Procedures for Server Level Permissions Demo Code.sql
/*********************************************************************************************************************
****
**** Demo script for signing stored procedures with certificates
****
**** Provided as is, run at you on risk, and not on a production server!
****
*********************************************************************************************************************/