Monday, February 28, 2022

Get SQL Table row counts

CREATE TABLE TSTRowCounts(RowCount1 BIGINT,TableName VARCHAR(128))


EXEC sp_MSForEachTable 'INSERT INTO TSTRowCounts

                        SELECT COUNT_BIG(*) AS RowCount1,

                        ''?'' as TableName FROM ?'


SELECT  top 100 TableName, RowCount1  FROM  TSTRowCounts ORDER BY RowCount1 DESC


select * from TSTRowCounts

where RowCount1 >100000

No comments:

Post a Comment

Override custom dimension value on posting sales invoice in X++

 Requirement: 1. Override custom dimension value on posting sales invoice 2.  Ledger posting type as "Cost of goods, invoiced" ...