Find the user who dropped database table in SQL Server


Once a table was missing from our database and my project manager ask to find to the user who dropped the table I search on google and find the solution so I want to share my experience with you.


CREATE DATABASE myTest
GO

USE myTest
GO

CREATE TABLE Table1 (ID INT)
GO

ALTER TABLE Table1
ADD FirstCol VARCHAR(100)
GO

DROP TABLE Table1
GO


Run the above query, it will create a database and table also alters the table after that it will delete the created table. We want to see the changes history of this table, please follow the as given in below pic.



Once you click on schema changes history then you will found the following results




You can see the DDL operation history for table Table1.

No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...