Recently I visited a customer to do a SharePoint 2007 to 2013 upgrade and then I found some custom development in the databases.

Custom development

This was going to be an easy project and then I found the custom development. Someone had added some bits to the SharePoint database.

This customer created custom SQL views and SQL stored procedures in their SharePoint database. I knew this was unsupported but all seemed to be working ok until we tried to upgrade their 2007 Environment to 2007 SP2.

It just didn’t want to work. Errors similar to the following appeared in the upgrade log:

[SPManager] [ERROR] [6/24/2013 3:42:47 PM]: Upgrade [SPContentDatabase Name=My_Content Parent=SPDatabaseServiceInstance] failed.
[SPManager] [ERROR] [6/24/2013 3:42:47 PM]: Invalid object name ‘dbo.MyCustomView’.
[SPManager] [ERROR] [6/24/2013 3:42:47 PM]: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.SharePoint.Utilities.SqlSession.ExecuteNonQuery(SqlCommand command)
at Microsoft.SharePoint.Upgrade.SPSqlCommandFactory.GetRowCount(String strTable)
at Microsoft.SharePoint.Upgrade.SPDatabaseWssSequence.LogTableRowCounts()
at Microsoft.SharePoint.Upgrade.SPDatabaseWssSequence.PreUpgrade()
at Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence.PreUpgrade()
at Microsoft.SharePoint.Upgrade.SPManager.Upgrade(Object o, Boolean bRecurse)

Looking at the upgrade.log (in 12/Logs) the problem was solved quickly.

The custom views and procedures didn’t use the dbo scheme. They used custom schemes. Sharepoint seems to collect all view names and then assumed the dbo scheme resulting in a view not found.

Painful for the customer. They had to delete all. Their custom views, procedures. Applications using the views/procedures failed and they had to realize that they had an unsupported SharePoint farm.


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@sharepains.com

Related Posts

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading