I use SQL SERVER 2008 R2 Express.
I'm on a NEW project with a database named myDatabase
with the db owner username myUsernamae
.
I would like to use ALTER ROLE
instead of sp_addrolemember
due to this message from Microsoft regarding sp_addrolemember (Transact-SQL):
Important This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER ROLE instead.
I tried
USE [myDatabase]
GO
ALTER ROLE [db_owner] ADD MEMBER [myUsername]
GO
but I keep getting this error message:
Incorrect syntax near the keyword 'ADD'.
What is the correct syntax?