Skip to content

Instantly share code, notes, and snippets.

View GeorgeDellinger's full-sized avatar

GeorgeDellinger

View GitHub Profile
@GeorgeDellinger
GeorgeDellinger / FindSynonym.sql
Last active December 16, 2015 22:08
MS SQL Synonym helper Find out where the synonym is pointing. Gets added to the master db of your server. Add it to your Tools|Options|Environment|Keyboard Query Shortcuts. Then just highlight a keyword to search and use the shortcut.
USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[sp_FindSynonym]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_FindSynonym]
@GeorgeDellinger
GeorgeDellinger / UnshelveBranch
Created May 2, 2013 18:33
Unshelving a Shelveset to a Different Branch in TFS - Public version
tfpt unshelve "my selveset 1;username" /migrate /nobackup /source:$/server/folder1 /target:$/server/folder2
@GeorgeDellinger
GeorgeDellinger / TestMethod_LiveTemplate.cs
Created April 11, 2013 15:03
Test Method Live Template
[TestMethod]
public void $Assertion$()
{
Assert.Inconclusive("Not yet implmemented.");$END$
}
@GeorgeDellinger
GeorgeDellinger / TestClass_LiveTemplate.cs
Last active December 16, 2015 02:39
TestClass Live Template
[TestClass]
public class $Scenario$ : $BaseContext$
{
[TestMethod]
public void $Assertion$()
{
Assert.Inconclusive("Test not yet implemented.");$END$
}
}
@GeorgeDellinger
GeorgeDellinger / ContextSpecification_FileTemplate.cs
Last active December 16, 2015 02:39
ContextSpecification File Template
namespace $NAMESPACE$
{
/// <summary>
/// Base class for BDD-style tests.
/// </summary>
/// <remarks>
/// Taken from: http://blogs.msdn.com/b/elee/archive/2009/01/20/bdd-with-mstest.aspx
/// See also: http://dannorth.net/introducing-bdd/
/// </remarks>
public abstract class ContextSpecification
@GeorgeDellinger
GeorgeDellinger / ContextSpecificationLiveTemplate.cs
Last active December 16, 2015 02:39
ContextSpecification.cs - Live Template
namespace $NAMESPACE$
{
public static class $SUT$Tests
{
public class $SUT$Context : ContextSpecification
{
protected $SUT$ Sut;
protected override void Context()
{
@GeorgeDellinger
GeorgeDellinger / sp_export_Objects.sql
Created April 8, 2013 17:22
Create script of all stored procedures, views and functions for a database in dependency order.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_export_Objects]
AS
BEGIN
SET NOCOUNT ON
CREATE TABLE #ObjectHierarchy
(
@GeorgeDellinger
GeorgeDellinger / sp_FindColumn.sql
Created April 8, 2013 17:15
Find SQL Columns. Gets added to the master db of your server. Add it to your Tools|Options|Environment|Keyboard Query Shortcuts. Then just highlight a column to search and use the shortcut.
use master
go
if exists (select * from sysobjects where id = object_id(N'[dbo].[sp_FindColumn]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_FindColumn]
GO
Create Procedure dbo.sp_FindColumn
@Column varchar(max)
AS