Dea All,
I want to log the data in the database when user updated the record i want to move the pervious record to temp table for logging.
CREATE TABLE Test_Mst
(
id INT PRIMARY KEY IDENTITY (1,1),
testcol1 nvarchar(max),
testcol2 nvarchar(max),
testcol3 nvarchar(max),
testcol4 nvarchar(max),
testcol5 nvarchar(max),
chrActive CHAR (1) DEFAULT 'Y'
)
GO
CREATE TABLE Test_Mst_History
(
id INT,
testcol1 nvarchar(max),
testcol2 nvarchar(max),
testcol3 nvarchar(max),
testcol4 nvarchar(max),
testcol5 nvarchar(max),
chrActive CHAR (1)
)
GO
INSERT INTO Test_Mst
SELECT REPLICATE('A',5000),
REPLICATE('B',5),
REPLICATE('C',5),
REPLICATE('D',5),
REPLICATE('E',5),
'Y'
when i update the record and i want to log the pervious data in my test_mst_history.
should i use trigger or procedure
Thanks