Skip to content

Instantly share code, notes, and snippets.

View Dreyer's full-sized avatar

Matthew Dreyer Dreyer

View GitHub Profile
@Dreyer
Dreyer / database_fragmentation.sql
Created July 3, 2017 17:59
Display database fragmentation for each table.
-- USE AdventureWorks;
SELECT
s.name AS 'sys_schema',
t.name AS 'sys_table',
i.name AS 'sys_index',
x.alloc_unit_type_desc,
x.avg_fragmentation_in_percent,
x.page_count
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) x
INNER JOIN sys.tables t ON t.object_id = x.object_id
@Dreyer
Dreyer / keybase.md
Last active September 14, 2019 13:21

Keybase proof

I hereby claim:

  • I am dreyer on github.
  • I am dreyer (https://keybase.io/dreyer) on keybase.
  • I have a public key whose fingerprint is 1FC2 90F9 9E14 B6D8 35D4 BC81 4758 2E67 AAD0 DFCD

To claim this, I am signing this object: