Wednesday, February 1, 2012

Friday, January 6, 2012

Get Url Left Part

HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);

Monday, December 12, 2011

Change url and title with Javascript ShareThis


addthis.update('share', 'url', url);
addthis.update('share', 'title', $("title").text());

Friday, November 25, 2011

Kill all connections to a Microsoft SQL Server DB


-- Create the sql to kill the active database connections
declare @execSql varchar(1000), @databaseName varchar(100)
-- Set the database name for which to kill the connections
set @databaseName = 'Massive.dev'

set @execSql = ''
select  @execSql = @execSql + 'kill ' + convert(char(10), spid) + ' '
from    master.dbo.sysprocesses
where   db_name(dbid) = @databaseName
     and
     DBID <> 0
     and
     spid <> @@spid
exec(@execSql)

Source:
http://blog.tech-cats.com/2008/01/kill-all-database-connections-to-sql.html