Will the below issue be resolved if I upgrade from Version service pack 1 to 2?
I got an error when executed my stored proc from sql server 2012 and here is the error message:
Msg 8623, Level 16, State 1, Procedure Employee_Timesheet, Line 17
The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
Upgrading will not fix this issue - but you should upgrade to service pack 3 and the latest CU anyways.
The problem is your query - you need to review the query and rewrite it so it isn't too complex for the optimizer. Either you have way too many tables or you are querying from a derived table, that is using a derived table, that is using a derived table, and on and on...
It could also be caused by querying a view that is a view of a view that is a view of a view, and so on...