There is a fast and easy way to determine the number of rows in a table. Instead of using queries like:
Select COUNT(*) from tablename
where it is necessary to use the datatable, you can use the systemtable:
SELECT rows
FROM sys.sysindexes
WHERE (id = OBJECT_ID('tablename'))
AND (name = 'PrimaryKey name').
This is very fast, because you select only one row.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment