Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>SQL Server does not store explicit information about who created or modified an object. There is information in the metadata catalog about who is the owner of a given object, or to what schema does the object belong to:</p> <pre><code>select * from sys.objects where object_id = object_id('&lt;object name&gt;'); </code></pre> <p>Depending on the object type either the principal_id is populated with the database principal ID of the owner, or the schema_id is populated with the Id of the schema to which the object belongs. All schemas have an owner and which can be retrieved from the metadata catalog:</p> <pre><code>select * from sys.schemas </code></pre> <p>However note that these will only reveal the <em>owner</em> of the object. The owner does not necessarily means the user that created it or modified it. Ownership of objects can be changed during creation or after creation with the <a href="http://msdn.microsoft.com/en-us/library/ms187359.aspx" rel="nofollow noreferrer">ALTER AUTHORIZATION</a> statement, making identification by ownership unreliable at best. Also all members of sysadmin role map to the same database principal, dbo, in every database.</p> <p>To properly identify the the user that created an object you should deploy auditing methods, but that require prior deployment of the audit. Some forensics can be done after the fact if audit was not deployed:</p> <ul> <li>You can dig into the log file, Paul Randal <a href="http://www.sqlskills.com/BLOGS/PAUL/post/Finding-out-who-dropped-a-table-using-the-transaction-log.aspx" rel="nofollow noreferrer">has an example in his recent blog</a>.</li> <li>You can look into the <a href="http://technet.microsoft.com/en-us/library/cc293615.aspx" rel="nofollow noreferrer">default trace</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload