Skip to content

Instantly share code, notes, and snippets.

View rvjykmr's full-sized avatar

Vijayakumar Ranganathan rvjykmr

View GitHub Profile
@rvjykmr
rvjykmr / disablestrongname.ps1
Created September 30, 2016 17:50
Powershell script for disabling Strong Name Validation
Function DisableStrongSignValidation
{
reg DELETE "HKLM\Software\Microsoft\StrongName\Verification" /f
reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64")
{
reg DELETE "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification" /f
reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f
}
@rvjykmr
rvjykmr / get-all-table-sizes.sql
Created January 3, 2020 02:39
Get all the table sizes for a particular SQL Server database
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB