Quantcast
Channel: Welcome To TechBrothersIT
Viewing all articles
Browse latest Browse all 1954

How to Change the Ownership of a Database in SQL Server - SQL Server DBA Tutorial

$
0
0
In this video you will learn how to change owner of a database in SQL Server? video provides different following ways to do it.

1- How to change database owner using Store Procedure
2- How to change database owner using Alter Authorization statement.

Scripts:

Use Demo

--EXEC sp_changedbowner 'New Owner Login'
EXEC sp_changedbowner 'sa'

-- Changing database owner using Alter Authorization to Login [TECHBROTHERS\clusteradmin]
ALTERAUTHORIZATIONONDatabase:: Demo TO [TECHBROTHERS\clusteradmin]


How to Change the Ownership of a Database in SQL Server - SQL Server DBA Tutorial



Viewing all articles
Browse latest Browse all 1954