I have a indexed view where I basically need to do this
SELECT ...
CASE
WHEN ISDATE(ColumnName) = 1 THEN CONVERT(datetime, ColumnName, 103)
ELSE NULL
END AS ViewColumn
....
Trying to create the index yields:
Cannot create index on view '....'. The function 'isdate' yields nondeterministic results. Use a deterministic system function, or modify the user-defined function to return deterministic results.
MSDN says
ISDATE is deterministic only if you use it with the CONVERT function,
if the CONVERT style parameter is specified, and style is not equal to 0, 100, 9, or 109.
here http://msdn.microsoft.com/en-us/library/ms187347.aspx.
But I don't know what that means at all. As far as I can tell, I am using it with a CONVERT function....
Any way to work around this?