Previous
Left Arrow
Handling Nested Query Literals so they are not used in the Main SELECT's GROUP BY Statement
Current Code Entry
Next
CFF Coding Source - 
Information on how to use SSMS more efficiently
  • Creating Indexes that include all columns that will display to your page in SQL Server.

    Article Entry Date: March 9,2026 @ 01:52:21 / Last Updated On: March 9,2026 @ 01:52:21
Creating Indexes can be the best thing you do for your SQL Server or any database server.
The indexes help your Server to find the data that the Query is hunting for.
Making your Setup fast and less resource-intensive.

To create an [Index] for the ID Column that is in another Table. (The Main Table ID is already indexed, so you do not have to create it, as it's already there.)
Here we will create an Index for MainID from MainTable
To the SecondTable. These are called [JOIN]'s and are used to create [Relational Tables] structures for connected data.
I name them with the TableName_ColumnID.
This helps to find the Index within the list of indexes for each table. I do the same naming for [Stored Procures] as well.


This next script creates an Index that includes the items to display to your page.
Open a New Query for the Database.
Copy the following and paste it into the New Query.


However, when you do create an Index, and you find you have more items that need to be added, you have to [Drop] the current Index before you can add more to it.