how to set user as owner in sql code example Example: To change the database owner in SQL server Use OnlineRestaurant exec sp_changedbowner 'sa'