Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLEXEC() vs SQLPREPARE()

Status
Not open for further replies.

nirajj

Programmer
Mar 12, 2003
103
US
It might be very stupid question but can anybody tell me if SQLPREPARE() would actually make the execution faster or directly using SQLEXEC() would be a better deal when it comes to performance issue?

lets say i hv a query lcQuery

option 1 :
SQLPREPARE(DS, lcQuery)
SQLEXEC(DS)

option 2 :
SQLEXEC(DS,lcQuery)

Which would be faster ? I know SQLPREPARE compiles the query for execution but is it really required? Wouldnt SQLEXEC compile it anyway before execution?

Any insight ?

Thanks
 
The only time I have found sql prepare to be worth the trouble is of it is a really complicated SQL Statement and you are going to be running it multiple times.

Otherwise it is a total waste of time and effort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top