September 29, 2008 at 1:20 pm
Why is there a limit of creating 249 nonclustered indexes in SQL Server2000?
September 29, 2008 at 1:42 pm
Probably because the data type used for the indexId is a tinyint, hence only goes up to 255. 0 is the heap, 1 is the cluster, 255 is the blob. There's a couple more reserved iirc
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 30, 2008 at 5:33 am
Gail is correct, but just curious... you need more than 249 indexes on a single table? 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2008 at 6:58 am
Jeff Moden (9/30/2008)
Gail is correct, but just curious... you need more than 249 indexes on a single table? 😛
It's actually not hard to hit on larger tables, seeing as automatically created column statistics also take an index ID. Add in sparse columns and filtered indexes and we'll probably be seeing that limit 'exceeded' more often
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 30, 2008 at 7:50 am
Hi Gail
I checked datatype of indid in sysindexes is small int which permits Integer data from (-32,768) through (32,767).
so there has to be some other reason.
September 30, 2008 at 8:45 am
I think that it was a tinyint in SQL 7 or earlier. I know it was at one point.
It's a full int in SQL 2008 (at least if you look at the system tables directly)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply