Monday 15 February 2010

sql - Getdate() returning same value at different times! What is happening? -


Against the table with 1 million records, giving the same value for the following SQL run, date 1 date and date 2 column Is it, and it is 38 seconds to execute it is a required behavior and why?

  Make Fn_Test (@ a decimal) Return the table as return (SELECT @ one parameter, gatedate (date 1, partition test. * From partition); SELECT *, GETDATE () Date 2 Fn_Test (RAND (DATEPART, GETDATE ())))  

Is this any type of caching?

Yes, SQL semantics are not required that a non-deterministic function that can be evaluated on the current line Does not depend on for each line it is allowed to evaluate the function once and return the same value for all subsequent rows.


No comments:

Post a Comment