I need to see when a Database was created in SQL Server, and who created it if possible. Is there a command to get that data?
2 Answers
In Management Studio just right click on the Database and go to Properties. On the general tab it tells you when it was created. Most likely the owner is who created it but that can be changed. Though not usually.
In addition, here's a query that will get you the information FLAdmin refers to:
USE master SELECT sys.databases.name, create_date, sys.syslogins.name FROM sys.databases INNER JOIN sys.syslogins ON sys.databases.owner_sid = sys.syslogins.sid ORDER BY sys.databases.name Regarding owner vs. creator, I would argue that the owner is probably changed more often. For example, there is the thought out there that best practice for SQL 2005+ is to have the database owned by a low privileged account so the owner is set to that account. There are arguments for and against that but the point is you should consider in the context of who creates databases in your environment whether or not that database owner would be the same as the creator.