Posts tagged T-SQL

Redundant Indexes Part 1: Identifying Redundant Indexes That Are Not Used To Service Queries

Overview

Indexes are a powerful concept in any RDBMS. They can dramatically increase the performance of queries, but they can also become overly burdensome. Enter redundant, unused indexes. Every index is maintained by SQL Server after every INSERT, UPDATE, or DELETE statement. So, if there are indexes on a table that are redundant, and aren’t used to service any SELECT queries, then it is a waste of resources for SQL Server to store and maintain those indexes. This maintenance unnecessarily slows down INSERT, UPDATE, and DELETE statements. So when I found literally dozens of these indexes in each production database in this specific client’s environment, suffice it to say I was shocked.

Keep reading…

Altering Stored Procedure Families Programatically

Reprinted with permission from owner. Original at http://nlsimmons.com/SQLScraps/

Alter every stored procedure in a database that fits a given criteria

Recently I had to search for, and update, hard-coding server references for every stored procedure in a database. This amounted to altering over 60 stored procedures. Instead of going through each stored procedure, one-by-one, I used the following code to accomplish the task:

Keep reading…

We're Here To Help.

Database problem? Tell us a little bit about it.

Name*

Email*

Subject

Message*

captcha

* Required