@Hemachanderrao
You are correct. Good catch and thank you for pointing it out. In my reply above I recommened querying the Database (DB) but I forgot to specify to only query a mirror of the SQL database, not the actual production DB directly.
Querying a PROD DB is never best practice and could create problems, instead it is best to have a copy of the PROD database (called a Mirror) that stores a copy of all the same data as the PROD DB, backed up periodically or triggered by certain events.
A mirror DB can be queried without ever worrying about impacteding production services. Hermachanderrao was absolutely right to say not to query the DB directly. I left left out the part about only querying the mirror. Thank you for catchgin that, someone could have read my message and created problems for themselves.
Kind regards,
Ben