When upgrading the database using the installer automatically or with the DB migration scripts you come across a message similar to the following:
Changed language setting to us_english.
Killing database connections
Msg 102, Level 15, State 1, Procedure PR_InsertMailbox2, Line 197
Incorrect syntax near 'LegacyDN'.
Change the Compatibility level to either SQL 2005 (90) or SQL 2008 (100) on the MessageStats database.
1. Open SQL Server Management Studio
2. Expand Databases
3. Right-click MessageStats and click Properties
4. Click Options
5. Click the Dropdown for Compatibility level and change it from SQL 2000 (80) to SQL 2005 (90) or SQL 2008 (100) depending on what version of SQL you're running
6. Rerun the .msi package to upgrade MessageStats or manually upgrade the database using the migration scripts.