Is it possible to get the total count of records in db (5M records) using powershell?
$database = New-Object HP.HPTRIM.SDK.Database
$database.Id = "10"
$database.WorkgroupServerName = "dbnonprod"
$database.Connect()
$recordSearch = New-Object HP.HPTRIM.SDK.TrimMainObjectSearch($database, [HP.HPTRIM.SDK.BaseObjectTypes]::Record)
$recordSearch.SetsearchString("All")
$a = 0
foreach ($record in $recordSearch) {
$a+= $record.count
}
echo $a
And this is my error when trying to get the totalcount store on the db from content manager database
Content Manager Workgroup Server on 'dbnonprod' reported an error. Could not serialize the server-side recordset. Error with SQL Connection: The ODBC connection is not active any more, could be forcibly closed by the server or in load balancing.