Uma Mahesh

Uma Mahesh

Author is working as an Architect in a reputed software company. He is having nearly 21+ Years of experience in web development using Microsoft Technologies.

IIS 404 error when viewing ASPX pages

Root Cause By default, when IIS is installed on any version of the Windows Server 2003 family, IIS only serves static content (HTML). Resolution To permit IIS to serve dynamic content, the administrator must unlock this content in the Web…

Restriction Operator in LINQ

Restriction Operatorswhere is the restriction operator. It applies filter criteria on the sequence. The values of the sequence are filtered based on a supplied predicate. The where operator does not initiate the execution of the query. The query is executed…

Finding Possible Bad Indexes in SQL Server

CREATE PROCEDURE FindPossibleBadIndex AS BEGIN — Possible bad Indexes (writes > reads) DECLARE @dbid INT SELECT @dbid = DB_ID() SELECT ‘Table Name’ = OBJECT_NAME(s.object_id), ‘Index Name’ = i.name, i.index_id, ‘Total #of Writes’ = user_updates, ‘Total #of Reads’ = user_seeks +…

Finding Missing Indexes

The Below script will brings the Missing Indexes in the databases — =================================================== — Author: V.U.M.Sastry Sagi — Create date: 01/30/2011 — Description: Fetches the Missing Indexes — =================================================== CREATE PROCEDURE [DBO].[FINDMISSINGINDEXES] AS BEGIN SELECT MID.STATEMENT, MIGS.AVG_TOTAL_USER_COST * ( MIGS.AVG_USER_IMPACT…

Finding the size of the Tables inside a DB

The Below code will fetches each Table Name,# of Rows in that table, Reserved Size, Index Size,UnUsed Space in the given Database. — =================================================== — Author: V.U.M.Sastry Sagi — Create date: 01/12/2011 — Description: Fetches the tables and the size…

Droping a Database by Force

The Below Procedure will drop the Database by force though it is accessing by the End Users. — ============================================= — Author: V.U.M.Sastry Sagi — Create date: 12/05/2010 — Description: Drops a Database by Force — ============================================= CREATE PROCEDURE [dbo].[dropDBByForce](@DBName VARCHAR(100))…

Finding Distance Between two Locations

The below code will calculate the distance (Displacement) between two locations based on longitude and latitude. — ============================================= — Author: V.U.M.Sastry Sagi — Create date: 11/30/2010 — Description: Gets the distance between two locations — ============================================= CREATE FUNCTION [dbo].[getDistanceBetweenLatLon] (…

SQL Server 2008 Extended Events

SQL Server 2008 Extended Events are the new low level, high performance eventing system in SQL Server. They use less system resources and provide better tracking of SQL Server performance than previous methods like Perfmon and SQL Trace/Profiler events. Performance…