Hello guys,
I don't know how exactly I can do this, an example will help me a lot:
Well, let me show you the structure of the two tables:
Table_A
CL_DATE smalldatetime
CL_NAME varchar(50)
CL_FONE varchar(20)
CL_CGC Varchar(30)
Table_script
SC_DATE smalldatetime
SC_SCRIPT VARCHAR(3000)
SC_TYPE VARCHAR(20)
If I insert a new value in the table_A, my trigger will create a command line script to be recorded in TAB_SCRIP, then:
INSERT INTO TABLE_A (CL_DATE, CL_NAME, CL_FONE, CL_CGC)
VALUES
('20071205','ALEX','14-784
59632','74
1852963124
5')
If in TABLE_A was updated then a command line script with those fields and values must be created.
UPDATE TABLE_A SET CL_DATE=XX, CL_NAME=XX, CL_FONE=XX
WHERE CL_CGC=XX
If in TABLE_A was a row deleted, the same thing:
DELETE FROM TABLE_A WHERE CL_CGC=XX'
after create the correct script I need to record this script in my Table_script
Thanks
Start Free Trial