This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Drop all non-system stored procs */ | |
DECLARE @name VARCHAR(128) | |
DECLARE @SQL VARCHAR(254) | |
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name]) | |
WHILE @name is not null | |
BEGIN | |
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']' | |
EXEC (@SQL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: ELMAH logs the errors anyway | |
protected void Application_Error(object sender, EventArgs e) | |
{ | |
var exception = Server.GetLastError(); | |
var httpException = exception as HttpException; | |
if (httpException != null) | |
{ | |
switch (httpException.GetHttpCode()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<modules runAllManagedModulesForAllRequests="false"> | |
<!-- disable authorization section --> | |
<remove name="UrlAuthorization" /> | |
<!-- disable unused authentication schemes --> | |
<remove name="WindowsAuthentication" /> | |
<remove name="PassportAuthentication" /> | |
<!-- disable ACL file and directory check --> | |
<!-- <remove name="FileAuthorization" /> --> | |
<!-- We don't use ASP.NET Profiles --> | |
<remove name="Profile" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRY | |
BEGIN TRANSACTION | |
-- statements here | |
COMMIT TRAN | |
END TRY | |
BEGIN CATCH | |
IF @@TRANCOUNT > 0 | |
ROLLBACK TRAN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
DECLARE @dbname SYSNAME | |
SET @dbname = 'DATABASENAME' | |
DECLARE @spid INT | |
SELECT @spid = MIN([spid]) FROM [master].[dbo].[sysprocesses] WHERE [dbid] = DB_ID(@dbname) | |
WHILE @spid IS NOT NULL | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://stackoverflow.com/a/16310139/108374 | |
CREATE LOGIN [IIS APPPOOL\MyAppPool] FROM WINDOWS; | |
CREATE USER MyAppPoolUser FOR LOGIN [IIS APPPOOL\MyAppPool]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Disable all table constraints | |
ALTER TABLE MyTable NOCHECK CONSTRAINT ALL | |
-- Enable all table constraints | |
ALTER TABLE MyTable CHECK CONSTRAINT ALL | |
-- Disable single constraint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @TableName varchar(255) | |
DECLARE TableCursor CURSOR FOR | |
SELECT table_name FROM information_schema.tables | |
WHERE table_type = 'base table' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER DATABASE [VoracioPlatform] | |
SET READ_COMMITTED_SNAPSHOT ON | |
GO | |
ALTER DATABASE [VoracioPlatform] | |
SET ALLOW_SNAPSHOT_ISOLATION ON | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set statistics time on | |
-- execute queries | |
set statistics time off | |
-- http://stackoverflow.com/a/11675263/108374 |