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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using functions in stored procs -> ignores table indexes?

Status
Not open for further replies.

redlam

MIS
Jun 28, 2000
218
US
I have heard that using functions such as 'convert' in stored procedures forces SQL to ignore all table indexes.  Does anyone know if this is true?  How can I use functions in stored procedures and be sure that table indexes are utilized?
 
I haven't heard that one, but if you are using a sp without parameters, then the sp will not normally be recompiled when it is run.&nbsp;&nbsp;This can cause some poor use or non use of indices, depending on how the sp was originally compiled.<br>The WITH RECOMPILE option can force the sp to be optimized every time it is run.<br>I wonder whether the implicit conversion of data types in SQL Server has any impact on the use of indices though.&nbsp;&nbsp;Anyone know? <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top