Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Try surrounding it with the quoted identifier:

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

Notice the square brackets.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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