ADO and SQL server which is the fastest query

ADO and SQL server which is the fastest query
LOCATE or WHERE (SQL instr) or is there a faster way to know if a record exist?

Comments

  1. LOCATE searches records on your client Dataset. That means, records has been first transfered from server to client trough a SELECT statement. If there are millions of records, thats a bad idea. SQL WHERE search for records on the database server. Thats almost the better approach.

    ReplyDelete
  2. Also, MS SQL Server doesn't have locate natively either, so WHERE is your only true option.  That speed again, depends a lot on the views and indexes you have available.

    ReplyDelete
  3. It depends on task. You may fall into situation (in multi-user environment) that if the record exists at the time you query it for existance, it may not exist (or vise versa) at the time you take a decision based upon record existance.

    ReplyDelete

Post a Comment