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?

6

Try surrounding it with the quoted identifier:

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

Notice the square brackets.

  • 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. – deutschZuid Aug 22 '12 at 23:09
  • @JamesJiao No problem, glad to help. – Thomas Stringer Aug 23 '12 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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