According to this kb article on what to do if your user database is gone, it recommends the following three actions
sqlcmd –E -S InstanceName –d master
1> ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName
2> GO
The problem here is the SQLLogin in this case is DOMAIN\user, but when I type that sqlcmd says Incorrect syntax near '\'
I've tried DOMAIN\\user and 'DOMAIN\user' but neither work.
SQL is the command interpreter here, not the shell, so escaping with another \ will not work. You have to surround the login with brackets.
you tried escaping it with another \ ? would be