Skip to content

Instantly share code, notes, and snippets.

View andywhite37's full-sized avatar

Andy White andywhite37

View GitHub Profile
@andywhite37
andywhite37 / userscript_rally.js
Created August 1, 2013 03:29
Userscript for Rally tweaks.
// ==UserScript==
// @name RallyDev Tweaks
// @namespace http://acdub.com
// @version 0.1
// @description Usability tweaks for rallydev.com
// @match http://*.rallydev.com/*
// @match https://*.rallydev.com/*
// @copyright 2013+, Andy White
// @require http://code.jquery.com/jquery-1.8.3.min.js
// ==/UserScript==
@andywhite37
andywhite37 / add_self_to_sql_sysadmin.cmd
Last active October 12, 2015 18:18
Regain sysadmin rights on SQL Server database (e.g. SQLEXPRESS instance)
@echo off
rem
rem ****************************************************************************
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem This code is licensed under the Microsoft Public License.
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
@andywhite37
andywhite37 / kill_all.sql
Last active September 30, 2015 00:48
SQL Server Kill Connected Processes
-- Kill all processes connected to a database.
use master;
declare @DatabaseName varchar(50);
declare @Spid varchar(20);
declare @Command varchar(50);
set @DatabaseName = 'MyDatabase';
print 'This query''s SPID: ' + convert(varchar, @@spid);
@andywhite37
andywhite37 / count_records.sql
Last active September 30, 2015 00:47
SQL Server Count Records
declare @TableName nvarchar(50);
declare @RecordCount int;
declare @Sql nvarchar(255);
declare TableCursor cursor for
select t.table_name from information_schema.[tables] t
order by t.table_name;
open TableCursor;