| | |
Get records from current year
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 42
Reputation:
Solved Threads: 5
0
#12 22 Days Ago
This might be true on SQL 2005. I compared execution plans and the cost was 50/50 using functions and constants. There was no discernable difference in retrieval speeds, but I wasn't using a large table to do so.
What I do know is a user had defined a hash function and was using it on the other side from the column. It was taking 13 seconds to retrieve the data that matched the hash. Changed the routine to use a constant varchar variable and the response time went to 25 milliseconds. I also know I read a book that says the function is executed against every row in a table and shouldn't be used when the result is a constant value.
Of course the book and I can be out of date now.
What I do know is a user had defined a hash function and was using it on the other side from the column. It was taking 13 seconds to retrieve the data that matched the hash. Changed the routine to use a constant varchar variable and the response time went to 25 milliseconds. I also know I read a book that says the function is executed against every row in a table and shouldn't be used when the result is a constant value.
Of course the book and I can be out of date now.
![]() |
Similar Threads
- returing the current year (Java)
- displaying current year in textbox (VB.NET)
- Current month name (ASP.NET)
- Validate the input date by comparing it with current year using Date function Date(Y) (PHP)
- Logic to Convert Days From 1800 to a Date (Month, Day, Year) (C++)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
Other Threads in the MS SQL Forum
- Previous Thread: How to Create database in SQL Server using Javascript & HTML?
- Next Thread: LEFT JOIN problem
| Thread Tools | Search this Thread |





