I use the ROWCOUNT field in SYSTABLES to get fast the rowcount of all my tables from a .NET App using Oledb (i don't want to use a query to get it becasue it takes too much time on big tables).
The problem is: after deleting rows from the table, that ROWCOUNT number in SYSTABLES is not updated. I tested some commands and even found that running ROWCOUNT TABLENAME in SqlTalk works and is very fast, but if i try to call that as a query from .NET using OLEDB it's returning nothing, sample code:
using (var connection = ConnectionFactory.CreateConnection(NombreBaseModelo))
{
using (OleDbCommand cmd = connection.CreateCommand())
{
foreach (Tabla ot in LstTables)
{
cmd.CommandType = CommandType.Text;
cmd.CommandTimeout = 5000;
cmd.CommandText = "ROWCOUNT " + ot.NAME;
var sRet = cmd.ExecuteScalar();
ot.ROWCOUNT = int.Parse(sRet);
}
}
}
Is there any way to tell SqlBase to update Rowcount for each table in systables?
Or as alternative, is there any way to make this code work?
Thanks!