I'm using SQL Server 2005 with LLBLGen version 2.0, the latest build. I've recently added a persisted computed column with the definition:
[Date] AS (CONVERT([datetime],CONVERT([varchar],[start],(101)),(101))) PERSISTED NOT NULL
and now I get an error message when deleting entities from the table:
DELETE failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.
I've added a call to DbUtils.SetArithAbortFlag(true) and it does work. From SQL Server Profiler:
BEGIN TRANSACTION tx
go
exec sp_executesql N'SET ARITHABORT ON;DELETE FROM [heathandcocom1].[ScheduleEntry] WHERE ( ( ( ( ( [heathandcocom1].[ScheduleEntry].[HotelID] = @HotelID1 AND [heathandcocom1].[ScheduleEntry].[IsTemplate] = @IsTemplate2) AND [heathandcocom1].[ScheduleEntry].[Start] >= @Start3) AND [heathandcocom1].[ScheduleEntry].[Start] < @Start4) AND [heathandcocom1].[ScheduleEntry].[AssignmentID] IN (@AssignmentID5)));SET ARITHABORT OFF;',N'@HotelID1 int,@IsTemplate2 bit,@Start3 datetime,@Start4 datetime,@AssignmentID5 int',@HotelID1=22,@IsTemplate2=0,@Start3='2007-06-01 00:00:00:000',@Start4='2007-06-08 00:00:00:000',@AssignmentID5=26
go
But this query still fails with the same message. However, if I move the 'SET ARITHABORT ON' statement to before the 'exec' call (in Query Analyzer), the query succeeds.
I can work around it if needed by making the column non-computed and updating the field before saving.