When you try to manage your Microsoft Windows SharePoint
Services content database by using the Manage Content
page in SharePoint Central Administration, you may receive
one of the following error messages:
‘Database_Name’ already exists. (Error
The current user or the application pool identity
of the virtual server is not the owner of the database
' on server
This issue may occur when the database owner of the database
that you are connecting to is different from the application pool identity that
SharePoint is running under.
To resolve this issue, change the database ownership and the
permissions for the content database to match the identities of the virtual
server accounts for content and configuration. To do this, follow these steps:
- On the computer that is running Microsoft SQL Server,
click Start, point to All Programs, point to
Microsoft SQL Server, and then click Query
- In the Connect to SQL Server dialog box,
type the server name in the SQL Server box, and then click
- On the Query menu, click Change
- In the Select Database of
Server_Name box, click the content database
that you want to update, and then click OK.
- In the Query pane, type the following
Note In lines 3 and 4 of the query, replace
with the domain account for the content virtual server and the domain account
for the SharePoint Central Administration virtual server. If the accounts are
the same, SQL Query Analyzer displays an error when you run the query, but the
process still succeeds.
DECLARE @ContentVSAccount nvarchar(255)
SET @AdminVSAccount =
EXEC sp_grantlogin @ContentVSAccount;
EXEC sp_changedbowner @AdminVSAccount;
IF NOT EXISTS
(SELECT * FROM sysusers WHERE name=@ContentVSAccount)
EXEC sp_addrolemember 'db_owner',
- On the Query menu, click
If you are running Windows SharePoint Services with WMSDE, there
are separate steps to resolve the problem. In the WMSDE installation, the
application pool identity for the SharePoint Central Administration is Network
Service. For SQL 2000, you cannot change the database owner to Network Service
because of a design limitation. The workaround for WMSDE installations is to
add Network Service to the SYSADMIN role in WMSDE, add the database back by
using SharePoint Manage Content databases, and then drop the role for Network
Service back to its original settings.
To set Network Service as
SYSADMIN, follow these steps:
- Start an OSQL Session.
To do so, click
Start, click All Programs, click
Accessories, and then click Command
- At the command prompt, start an OSQL session by typing the
following syntax where servername is the name of
your server, and then pres ENTER:
osql -S servername\sharepoint -E
- Type the following command, and then press ENTER:
sp_addsrvrolemember 'nt authority\network service', 'sysadmin'
- Type go, and then press
- In the SharePoint Central Administration, add the content
database to the virtual server.
- After the content database is added back, drop Network
Service role back to Security Administrators and Database Creators.
- Type the following command in the OSQL command prompt, and
then press ENTER:
sp_dropsrvrolemember 'nt authority\network service', 'sysadmin'
- Type go, and then press
- Type quit to exit the OSQL session.
For more information, see the Microsoft Windows SharePoint Services Administration Guide
. For more information about required database owner permissions
and database permissions, see the "Migrating from WMSDE to SQL Server" topic in
the "Backup and Migration" topic.