An insert query to a table that has foreign key references cannot generate a plan with error 8624 when arithabort is set to be off. Server: Msg 8624, Level 16, State 1, Line 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.
SqlException: Internal Query Processor Error11-11-09 14:26:00.953 [(null)][1] ERROR - Shared - execute[ss_sp_UsageRecords_Tracking_Insert] @11-11-09 14:26:00.953 [(null)][1] ERROR - Shared -System.Data.SqlClient.SqlException: Internal Query ProcessorError: The query processor could not produce a query plan. For moreinformation, contact Customer Support Services.The root of the problem is a bug in SQLExpress / SQL Server 2005. You may have started out in an earlier version of SELECTserver XM, which used MSDE, SQL 2000 then upgraded to 8.11, which changed the database to SQLExpress 2005 SP2. This issue appears to be related to the fact database compatibility is set to 80.
Setting database compatibility to be 90 resolves the issue. ALTER DATABASE database_nameSET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
http://technet.microsoft.com/en-us/library/bb510680.aspx