This Season
 

How to Correct Indexes With SQL Profiler

The SQL Profiler tool is included with the SQL Server database engine to help you find bottlenecks on the database server. The SQL Server Profiler can find slow queries so that you can optimize the tables and fix indexes. You add an index on a table that runs slowly and takes several seconds to return records to queries. The Profiler software tracks queries and shows you any problematic queries and tables.

Related Searches:
    Difficulty:
    Moderate

    Instructions

      • 1

        Open the SQL Profiler software from the Windows "SQL Server" program group. The first screen asks you to log in to your database. Type your username and password to log in to the SQL Server.

      • 2

        Type a name for the SQL Profiler. This is the name of the profile you run when you choose what queries you want to monitor the next time you open the Profiler software. Click "Standard" in the "Template" drop-down box.

      • 3

        Click "Run." The Profiler runs and displays queries, databases and tables used on the server. Click the "Start Time" column header. The column next to the start time for the query is the "End Time," and lets you evaluate which queries take the longest to run.

      • 4

        Open the SQL Server Management Studio software in the same "SQL Server" program group in the Windows menu. Right-click the table that you need to index from a query identified in the Profiler. Click "Indexes" to view a list of indexes.

      • 5

        Click "Add." Type a name for the index and choose the column used in the query shown in the Profiler. You create an index on the columns you query in the "where" clause of the query. Click "Close" to create the index.

    Related Searches

    References

    Read Next:

    Comments

    Follow eHow

    Related Ads