I'm trying to create a history table that stores deleted records as well as user that deleted the record. I know how to store the records but not the user.
The table definition looks like this:
CREATE TABLE HistoryComics(
Id INT IDENTITY PRIMARY KEY,
ComicId INT,
Title NVARCHAR(50),
Author NVARCHAR(50),
[Description] TEXT,
Issue INT,
Publisher VARCHAR(20),
CoverPage VARBINARY(MAX),
DateDeleted DATETIME DEFAULT SYSDATETIME(),
DeletedBy VARCHAR(20)
);
I've seen examples of how to do this with MySQL but not with T-SQL