USE [ExperimentalDB]
GO
--Create table tblTestEmployee
CREATE TABLE [dbo].[tblTestEmployee]
(
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[EmpName] [varchar](100) NOT NULL,
[Address] [varchar](100) NOT NULL
)
--Populate some records to the tblTestEmployee
INSERT INTO [dbo].[tblTestEmployee]
VALUES('Emp1','Address1'),('Emp2','Address2'),('Emp3','Address3'),('Emp4','Address4')
--Drop the column Address
ALTER TABLE [dbo].[tblTestEmployee] DROP COLUMN [Address] --ONLY this
--Drop the table
DROP TABLE [dbo].[tblTestEmployee] -- NOT THIS
--Find who has done that
SELECT [Transaction Id], [Begin Time], SUSER_SNAME ([Transaction SID]) AS [User],[Transaction Name],Operation,[Transaction SID]
FROM fn_dblog (NULL, NULL)
我的目標是要找出誰已降至列[聯繫地址]
但通過觀察的輸出用戶fn_dblog,我無法弄清楚。 任何人都可以幫助我。
謝謝。
我創建了[dbhistory.com](http://dbhistory.com)來回答這樣的問題。 –