Quantcast
Channel: Recent Edits
Viewing all articles
Browse latest Browse all 12198

Error in query to determine the partition column

$
0
0
The query has a where clause AND c.column_id = 1;because of which this query always returns the first column of the table even if the partitioned column maybe 2nd or 3rd or nth.The correct query is:SELECT t.object_id AS Object_ID, t.name AS TableName, ic.column_id as PartitioningColumnID, col.COLUMN_NAME AS PartitioningColumnName FROM sys.tables AS tJOIN sys.indexes AS i ON t.object_id = i.object_idJOIN sys.columns AS c ON t.object_id = c.object_idJOIN sys.partition_schemes AS ps ON ps.

Viewing all articles
Browse latest Browse all 12198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>