September 7, 2010 at 7:07 am
Hi All.
I need to do a script that shows me the users on my sql server.
I have come this far:
select name,type_desc,create_date,modify_date,default_database_name
from sys.server_principals
where type in ('g','s')
BUT what i now need is to know who created these users?
Any assistance will be much appreciated.
September 7, 2010 at 7:35 am
who created the users is not saved anywhere...with a minor exception.
SQL does not keep track of who created or modified anything...except for a short period in the default trace.
the default trace keeps track of a short period of recent changes, and gets rolled over as space is needed to continuous tracking.
once it's out of the default trace, it's gone and cannot be discovered.
the easiest way is to use the built in report in the GUI, but chances are the data you seek has already been rolled over; if it's important in the future you will need to add your own DDL traces.

Lowell
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply