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.

NUnit : Introduction

There are several unit test tools in the market, but one of them is NUnit, the most popular tool for doing unit testing. So in this tutorial...