find sql command used by users in database code example Example: sql server get users select * from master.sys.server_principals