Recently we had some problems creating new content databases and adding them to SharePoint 2010 SP1.
From looking in the ULS logs I found the following.
10/22/2012 04:55:14.83 PowerShell.exe (0x477C) 0x0FB0 SharePoint Foundation Database 5586 Critical Unknown SQL Exception 2812 occurred. Additional error information from SQL Server is included below. Could not find stored procedure 'dbo.proc_GetDatabaseInformation'. aef39614-22b1-4cb2-9f8f-bfc624b9e7ba
10/22/2012 04:55:19.00 PowerShell.exe (0x477C) 0x0FB0 SharePoint Foundation Database 5586 Critical Unknown SQL Exception 208 occurred. Additional error information from SQL Server is included below. Invalid object name 'Groups'. aef39614-22b1-4cb2-9f8f-bfc624b9e7ba
10/22/2012 04:55:19.22 PowerShell.exe (0x477C) 0x0FB0 SharePoint Foundation PowerShell 6tf2 High Invalid object name 'Groups'. aef39614-22b1-4cb2-9f8f-bfc624b9e7ba
10/22/2012 04:55:19.23 PowerShell.exe (0x477C) 0x0FB0 SharePoint Foundation PowerShell 91ux High Error Category: InvalidData Target
After examinig our content database we were trying to Mount to sharepoint I noticed something strange, some of the schema objects in the database, specifically the ones mentioned above have been prefixed with the user account we used to run the power shell command, rather than “dbo” hence the errors during from SharePoint when attempting to mount the DB.
We traced this problem down to the fact that for some reason our DBA team had created the new content database with the default schema set to our admin user account rather than “dbo”.
Seem’s there must be a minor bug in the scripts that the Mount command invokes when building the new DB schema, most tables / proc’s views etc.. are created correctly regardless of default schema setting of the containing database, it appears as if a couple of the scripts that provision the schema into a new content database rely on the default schema value for the database and using it as the prefix in the create commands, thus if the default schema isn’t set to “dbo” you get the problem above.
One to look for if you run into this with your environments.