I'm trying to work out how many rows are being returned by an _mssql.MSSQLConnection object. (Aside there is a method "rows_affected", but I'm just using a SELECT statement so nothing is changing).
Is there a better way that this hack ?
matches = 0
query = "SELECT TOP 100 a.asset_id, .........."
conn.execute_query(query)
for row in conn:
matches += 1
# do operations on rows
# matches contains number of rows.
....
I tried len(conn) etc but get
TypeError: object of type '_mssql.MSSQLConnection' has no len()
Thanks in Advance,
Patrick