July 2020

Himanshu Patel with Database Design

SQL Server Tables and row counts

Using system objects we can find tables inflammations like no of row, indexes, key columns, etc. sys.tables: Returns a row for each user table in SQL Server. sys.partitions: Contains a row for each partition of all the tables and most types of indexes in the database. sys.dm_db_partition_stats: Returns page and row-count information for every partition …

SQL Server Tables and row counts Read More »

SSIS catalog database read

he SSISDB catalog is the central point for working with Integration Services (SSIS) projects that you’ve deployed to the Integration Services server. For example, you set project and package parameters, configure environments to specify runtime values for packages, execute and troubleshoot packages, and manage Integration Services server operations. The objects that are stored in the SSISDB catalog include projects, …

SSIS catalog database read Read More »

Find current database physical file detail in SQL server

Database files information using query

database_files: Contains a row per file of a database as stored in the database itself. This is a per-database view Reference: https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-files-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-filegroups-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-master-files-transact-sql?view=sql-server-ver15

SQL Server Table Statistics

Query statistics for a single table

sys.stats : Contains a row for each statistics object that exists for the tables, indexes, and indexed views in the database in SQL Server. sys.dm_db_stats_properties: Returns properties of statistics for the specified database object (table or indexed view) in the current SQL Server database. Use the following query to identify statistics auto-created by SQL Server …

Query statistics for a single table Read More »

Get fragmentation info for the tables

dm_db_index_physical_stats:Returns size and fragmentation information for the data and indexes of the specified table or view in SQL Server. For an index, one row is returned for each level of the B-tree in each partition. https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-index-physical-stats-transact-sql?view=sql-server-ver15