September 20, 2004 at 10:09 pm
While refering the updated books online of sql server 2000 ..:
Transact sql reference->functions->datetime functions
I found that "datename()" function is stated as non deterministic function.
I think its deterministic function.
What u think ? its books online mistake? or my view is wrong ?
Vidyadhar
September 21, 2004 at 12:06 am
what is deterministic and non deterministic?
whats diff between them,
i guess its non-deterministic, becoz the value get is not certain or fixed
its value changes
<a href="http://www.websolsoftware.com"> For IT jobs click here</a>
*Sukhoi*[font="Arial Narrow"][/font]
September 21, 2004 at 3:24 am
From BOL:
All functions are deterministic or nondeterministic:
Deterministic functions always return the same result any time they are called with a specific set of input values.
Nondeterministic functions may return different results each time they are called with a specific set of input values.
As for DATENAME() - it's non-deterministic. Here's a simple example where you call the function with the same arguments, yet it gives different results.
set language us_english
select datename(weekday, '2004-09-21')
set language svenska
select datename(weekday, '2004-09-21')
Changed language setting to us_english.
------------------------------
Tuesday
Changed language setting to Svenska.
------------------------------
tisdag
Most datefunctions are language sensitive, hence they are also nondeterministic.
/Kenneth
September 22, 2004 at 8:31 am
So why can't they be used in UDFs?
September 23, 2004 at 5:50 am
There is a lot of good info on userdefined functions to be found in BOL. (Books On Line) The answer to many questions can be found there
/Kenneth
October 1, 2004 at 7:07 am
Dont divert from the main question
October 4, 2004 at 1:38 am
If you're interested in the reasons as to why MS has implemented UDFs in a way that not allows nondeterministic functions to be included, Books On Line is a good place to start to get an understanding about the concepts.
BOL is there for everyone to use, and it should be your first choice of source for information and help.
As for the original question posted, that has already been answered in this thread.
/Kenneth
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply