In SQL Azure
, I want to assign login name [login1]
to user [dbo]
.
I am currently logged in with [login1]
account, and try this:
ALTER USER [dbo] WITH LOGIN = [login1]
But it is saying:
Cannot alter the user 'dbo'.
I have also tried this:
ALTER AUTHORIZATION ON SCHEMA::[dbo] TO [login1]
But it is saying:
Cannot find the user 'login1', because it does not exist or you do not have permission.
I am able to create new table like [dbo].[MyTable]
, but can not see it in the table list even though it existed.
Any ideas?
You can't re-map [dbo]
to [login1]
, but you can add [login1]
to the db_owner database role. For example:
-- in master db
CREATE LOGIN [login1] WITH PASSWORD = '{Some Password}'
CREATE USER [login1] FOR LOGIN [login1]
-- in user db
CREATE USER [login1] FOR LOGIN [login1]
ALTER ROLE [db_owner] ADD MEMBER [login1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With