I have a merge publication configured that has been running fine with no issues for many weeks. Here is my setup... Publisher - SQL 2008 SP1, Distributor - SQL 2008 R2, Subscriber - SQL 2008 SP1.
On Wednesday and Thursday of last week, I created a few hundred foreign keys referencing a table (user information for auditing). Then, on Friday evening, I started to receive this message:
Msg 8621, Level 17, State 1, Procedure MSmerge_sel_sp_18DB84E1A521483601D2A6D477F6483D, Line 85
The query processor ran out of stack space during query optimization. Please simplify the query.
I have traced it down, this command gets executed:
exec MSmerge_sel_sp_18DB84E1A521483601D2A6D477F6483D @maxschemaguidforarticle = 'F990B1EE-D52F-4DCA-8EEF-C1783DA47A0F', @type = 6
Which executes this: