Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
daidaluus
Yak Posting Veteran
73 Posts |
Posted - 2009-10-31 : 09:22:36
|
| I tried to build a scaler funtion that meet all requirements to be deterministic. but i failed. after a few tests i came to this test:CREATE FUNCTION fn1()RETURNS intASBEGINRETURN 1ENDwhen i query IsDeterministic of this function it returns 0SELECT OBJECTPROPERTYEX(OBJECT_ID('fn1'), 'IsDeterministic')but when i add WITH SCHEMABINDING clause to the function it will be IsDeterministic. i didnt see anywhere (including BOL) that SCHEMABINDING is a MUST for a function to be evaluated as deterministic. so is it true or is miss something? |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-10-31 : 11:01:05
|
| UDF must be specified WITH SCHEMA BINDING if you want it to be deterministic. Not clearly pointed out in BOL, so no, I don't think you missed it. BOL for SQL 2000 showa it in the sample code, but doesn't explain it in any detail. |
 |
|
|
|
|
|