SQLTeam.com | Weblogs | Forums

Inconsistencies among system tables?


I get a SQL Server 2008 database called ‘BLANK’. And it contains several tables, one of them is ‘MyTable’. Its object ID is 480720765.

I find a very strange problem in the table.

When I login as DAC mode and using the following statements:


select * from sys.syscolpars where id = 480720765;

I will get all the columns for ‘MyTable’, and their colid is from 1 to 21, as below:


But when I use the following statements to find the partition id for the table:


select partition_id from sys.system_internals_partitions where (object_id = '480720765') AND (index_id <= 1);

I will get the partition id as 72057594062897152.

Then if I use the following statements to find the columns of the partition:


select * from sys.system_internals_partition_columns where partition_id = '72057594062897152';

I will get all the columns for the partition, but the partition_column_id is from 0 to 20, instead of from 1 to 21.

Below is the result:


Originally I think syscolpars.colid should equal to system_internals_partition_columns.partition_column_id, since all other tables follow this way. But ‘MyTable’ is not. Why?


Post the table DDL

It's real simple. It's because MS designed or misdesigned it that way. And why on this good Green Earth would you be trundling about in the system database for this type of thing anyway?