Tuesday, 10 August 2010

Change database owner

We need to install all databases with the owner as sa. Our security policy stops developers been able to log on to the SQL servers with the sa account (which I agree with). For some of our custom maintenance plans to run we need the owner ot be sa.

So, to change the database owner do the following:
USE database_name
EXEC sp_changedbowner 'sa'