Wednesday, July 1, 2009

At some point during your SQL Server development time, you will eventually create a database while logged in to the server with a login other than SA.

If this happens, your dbo user account will be mapped to the account which created the database (call it sa2 for now).

A year later, when the db goes into production, you decide you want the sa account to be the owner.

In order to do so, you will need to run the following query:

USE [TroubleDatabase]
EXEC sp_changedbowner 'sa'

References:
http://alghourabi.blogspot.com/2008/09/changing-database-owner-when-dbo-is.html

0 Comments:

Post a Comment