I am trying to do the following for an IIS log table:
ALTER TABLE [W3CLog] ADD [LogTime] AS [date] + ([time] - '1900-01-01') PERSISTED
However, SQL Server 2008 tells me:
Computed column 'LogTime' in table 'W3CLog' cannot be persisted because the column is non-deterministic.
The table indicates this definition:
CREATE TABLE [dbo].[W3CLog]( [Id] [bigint] IDENTITY(1,1) NOT NULL, ... [date] [datetime] NULL, [time] [datetime] NULL, ... )
Why is this not determined?
I really need to index this field. There are currently 1598170 rows in the table, and it is painful to ask if we cannot complete the index search. Since this is UNION'd with some other log formats, we cannot just simply use the two columns separately.
source share