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
SELECT OBJECT_SCHEMA_NAME(I.OBJECT_ID) AS SchemaName, | |
OBJECT_NAME(I.OBJECT_ID) AS ObjectName, | |
I.NAME AS IndexName | |
FROM sys.indexes I | |
WHERE -- only get indexes for user created tables | |
OBJECTPROPERTY(I.OBJECT_ID, 'IsUserTable') = 1 | |
-- find all indexes that exists but are NOT used | |
AND NOT EXISTS ( | |
SELECT index_id | |
FROM sys.dm_db_index_usage_stats |
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
PRINT 'Missing Indexes: ' | |
PRINT 'The "improvement_measure" column is an indicator of the (estimated) improvement that might ' | |
PRINT 'be seen if the index was created. This is a unitless number, and has meaning only relative ' | |
PRINT 'the same number for other indexes. The measure is a combination of the avg_total_user_cost, ' | |
PRINT 'avg_user_impact, user_seeks, and user_scans columns in sys.dm_db_missing_index_group_stats.' | |
PRINT '' | |
PRINT '-- Missing Indexes --' | |
SELECT CONVERT (varchar, getdate(), 126) AS runtime, | |
mig.index_group_handle, mid.index_handle, | |
CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)) AS improvement_measure, |
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
$(document).ajaxError(function (event, xhr, settings) { | |
if (xhr.status == 401) { | |
var return_path = encodeURIComponent(window.location.pathname + window.location.search); | |
var loginPath = "/login.aspx" // Replace with your site's login page | |
window.location.href = loginPath + "?return_url=" + return_path + ""; | |
} | |
}); |
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
public static class Inferno { | |
public static bool GoToHell(this Person person) { | |
return person.GoTo(new HellLocation()); | |
} | |
public static bool GoTo(this Person person, Location location) { | |
person.Location = location; | |
return true; | |
} | |
} |
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
namespace Owin | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.IO; | |
public interface IResponseHandler | |
{ | |
Type TypeToHandle { get; } |