Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Indexes

Author  Topic 

neil
Starting Member

29 Posts

Posted - 2003-04-03 : 04:24:44


Is there any reason why you shouldn't put more than one column into the same index ?

Thanks




nr
SQLTeam MVY

12543 Posts

Posted - 2003-04-03 : 04:29:15
Depends on your needs.
It's called a compound index and is often a good idea.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-03 : 07:21:33
The only time it's a "bad" idea is if you index on columns A and B, in that order, but always join or search on column B and never A. That index can't be used because A is the first column. You can switch the column order, or add a separate index on column B alone, however.

Go to Top of Page
   

- Advertisement -