--- Change database owner
EXEC [AdventureWorks].dbo.sp_changedbowner @loginame = N'sa', @map = false
GO
--- Create database user to map SQL login account
CREATE USER [testdbuser] FOR LOGIN [testserverlogin]
--- Rename database user to a new name
ALTER USER [testdbuser] WITH NAME = NewNametestdbuser;
--- map database user to a SQL login account and Default Schema
ALTER USER [testdbuser] WITH login = [testserverlogin];
ALTER USER [testdbuser] WITH login = [testserverlogin] ,DEFAULT_SCHEMA =dbo;
No comments:
Post a Comment