SQLism

Logging and Blogging SQL Server Experiences.

Showing posts with label partition. Show all posts
Showing posts with label partition. Show all posts

Tuesday, September 23, 2014

Script to find number of rows in each partition in a partitioned table in SQL Server

SELECT t.NAME [table]
 ,p.rows
 ,p.partition_number
 ,v.boundary_id
 ,v.value
FROM sys.tables t
INNER JOIN sys.partitions p ON p.object_id = t.object_id
INNER JOIN sys.partition_range_values v ON v.boundary_id = p.partition_number
WHERE is_ms_shipped = 0
ORDER BY [table]
Posted by SQLism at 4:53 PM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: a, each, find, in, number, of, partition, partitioned, rows, Script, SQL Server, tables, to
Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2020 (6)
    • ▼  July (1)
      • Reorganize all indexes in a Database in SQL Server.
    • ►  March (1)
    • ►  February (4)
  • ►  2018 (3)
    • ►  August (3)
  • ►  2017 (10)
    • ►  December (1)
    • ►  October (1)
    • ►  June (1)
    • ►  May (1)
    • ►  February (4)
    • ►  January (2)
  • ►  2016 (7)
    • ►  December (1)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
  • ►  2015 (10)
    • ►  September (1)
    • ►  April (9)
  • ►  2014 (53)
    • ►  October (19)
    • ►  September (33)
    • ►  June (1)
  • ►  2013 (12)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2012 (9)
    • ►  September (1)
    • ►  August (6)
    • ►  July (2)
Simple theme. Theme images by luoman. Powered by Blogger.