4

I am trying to run the following statement to alter the authorization on an endpoint as the current login used for authorization is about to be deleted (left the company).

alter authorization on endpoint::Mirroring to domain\sys-admin-group

We use Windows authentication, so all our server logins have the backslash "\" character in it.

Here is the error I received:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '\'.

I have also tried to enclose the login in single quotes but received the following error:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'domain\sys-admin-group'.

I can't find any useful info on the MSDN ALTER AUTHORIZATION page (http://msdn.microsoft.com/en-us/library/ms187359.aspx). Any ideas?

0

1 Answer 1

6

Try surrounding it with the quoted identifier:

alter authorization 
on endpoint::Mirroring 
to [domain\sys-admin-group]

Notice the square brackets.

2
  • Bingo! Yatsi! I usually use the square brackets for weird db or column names like 1234-abc, but didn't think it would apply here. Worked like a charm. Thanks Shark. Aug 22, 2012 at 23:09
  • @JamesJiao No problem, glad to help. Aug 23, 2012 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.