In SQL Server Express something (I forget which version, but something fairly recent, like 2017, if that's possible), I'm trying to write a script to add users and assign some roles to them. Adding the user is working, but then I attempt to assign a role using this:
ALTER ROLE db_datareader ADD MEMBER HISAppLogin
Which appears to be right according to a variety of sites, yet I'm getting an error on the ADD, with the error message saying that WITH is expected. The line is taken straight from the MS documentation, and is confirmed on a variety of other sites, so I'm not sure what I am doing wrong. I can see that WITH is an option, but it's an option for doing something that doesn't seem right. So...what am I doing wrong?
ALTER ROLE db_datareader ADD MEMBER HISAppLogin
Which appears to be right according to a variety of sites, yet I'm getting an error on the ADD, with the error message saying that WITH is expected. The line is taken straight from the MS documentation, and is confirmed on a variety of other sites, so I'm not sure what I am doing wrong. I can see that WITH is an option, but it's an option for doing something that doesn't seem right. So...what am I doing wrong?