WITH CTE AS
(SELECT OBJECT_NAME(OBJECT_ID) Table_Name, ps.row_count AS Total_Rows
FROM sys.dm_db_partition_stats ps
WHERE index_id < 2
)
SELECT TOP 1 WITH TIES * FROM CTE
ORDER BY CTE.Total_Rows DESCUsing this code snippet we can get the table name that have maximum rows.
