I have the MS-SQL server and some jobs running every day on it. I can’t make one instruction to work correctly in theese tasks:
CREATE USER "DOMAIN\username"
Job fails at this step with “syntax error” message. But if I try to perform the same code in a query manually, everything works perfectly. Job also works fine if executing smth like:
CREATE USER "username"
without backslash symbol.
Specified domain- and user-names are correct and exist. Login for user “DOMAIN\username” already created and appeared in the list of all server logins.
All manipulation were performed via SQL Server Management Studio 2008 R2.
Help me, please, to solve this issue.
Need square brackets:
In practice it’s safer to use [ and ] (not “) for all identifiers because of vagaries of SET QUOTED_IDENTIFIER