Programmatically set a DB user to be db_owner

Viewed 37546

How can I assign the db_owner role to a user that I have created?

I am able to create a login and add them to the database. I don't know how to change their permission to db_owner using a SQL query.

I have a feeling I am maybe missing something with my query where I add the user to the database?

Here is the query to add the user to the database

CREATE USER [Driver-SOC-ChrisTest] FOR LOGIN [Driver-SOC-ChrisTest] 
WITH DEFAULT_SCHEMA=[dbo]
2 Answers
Related