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'



Post a Comment