March 12, 2018 at 1:10 pm
Hello,
please I need to do sql audit for all group or for all sysadmin.
I want to do dynamic, so its means when somebody will add someone, dont want to care about it, but lets track automaticaly.
I tried to input there AD group like server principal name, also sysadmin and nothing.
Is there any option how to do ??
Thanks
March 12, 2018 at 1:10 pm
([server_principal_name]='sa' OR [server_principal_name]='sysadmin')
sa was ok, but another sysadmin didnt catch..
March 12, 2018 at 1:45 pm
([server_principal_name] in (select name from sys.syslogins where sysadmin=1))
March 12, 2018 at 1:48 pm
goher2000 - Monday, March 12, 2018 1:45 PM([server_principal_name] in (select name from sys.syslogins where sysadmin=1))
Hi,
did you tested ?
I tried also and have problem with in --
tried also with script and with studio and errors
Msg 156, Level 15, State 1, Line 16
Incorrect syntax near the keyword 'in'.
Msg 102, Level 15, State 1, Line 16
Incorrect syntax near ')'.
March 12, 2018 at 2:01 pm
Ok,
so with some testing I see that
([database_principal_name]='dbo')
should be all sysadmin and also dbo, but not sure if I am really right. But for now best for me.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply