Good day Sai :-)
from which system it was created?
For this we will need to use the first step and cross information with the operating system information and the active domain and so on. Fot he scope of this trhead I will present the full answer for the first part of the question which is related to the work of the (very advanced) DBA.
How find who created database?
(1) It is very simple to get the owner of the DATABASE, which in many cases (especially in small companies) will probably be the same as the LOGIN who created the DATABASE, but the owner of the DATABASE is not necessarily the LOGIN who created the database since someone might have ALTER AUTHORIZATION for databases and change the LOGIN to another LOGIN.
Unfortunately, the information about the LOGIN who execute the creation of the database, is not stored in the database.
but no worry, this is why we are here :-)
SQL Server stores the information about DDL actions like CREATE DATABASE
, simply not in the database. Pulling the information is a bit more complex and requires a bit of internals knowledge and parsing of data and using an undocumented tool. It is not that complicated actually.
So... where SQL Server store information about DDL actions?
Answer: In the transaction log obviously :-)
And this is where we can get the information about the real LOGIN which created the database, assuming you have all the backups of the transaction log.
Here is a nice post I wrote several years ago to find who deleted a row from the table. The solution is exactly the same except that instead of searching for the action LOP_DELETE_ROWS
we need to search for the action ``
https://ariely.info/Blog/tabid/83/EntryId/154/SQL-Server-Who-deleted-my-record-last-time.aspx
I will write a fast blog step by step with full demo in a few XX (I have no idea how long it will take :-) But you have all the information and I just want to present full demo)
UPDATE: Step-By-Step full demo!
I published a full demo from the CREATE DATABASE to finding who created the database
https://ariely.info/Blog/tabid/83/EntryId/303/SQL-Server-Who-created-the-database.aspx
I hope this is useful :-)