pmoran10
Technical User
- Mar 5, 2010
- 1
I dont have much SQL experience but i need to insert a trigger into a table but there is about 10 million records and it seems to run through all the old records when i only want it to insert the trigger and run it on any new records not the 10 million old ones, it was taking hours
-- Trigger: f_tscrec1_trigg on playercolumns
-- DROP TRIGGER f_tscrec1_trigg ON playercolumns;
CREATE TRIGGER f_tscrec1_trigg
BEFORE INSERT
ON playercolumns
FOR EACH ROW
EXECUTE PROCEDURE f_tscrec1('tscrec');
So i just want it to insert the trigger now and everytime it inserts a new record run the trigger, its fine on smaller databases but on bigger ones its a disaster. Any ideas, as i said im a newbie to SQL? Im just inserting this via PGadmin in the SQL query tool
This is a postgreSQL database btw but i presume the SQL query is universal?
-- Trigger: f_tscrec1_trigg on playercolumns
-- DROP TRIGGER f_tscrec1_trigg ON playercolumns;
CREATE TRIGGER f_tscrec1_trigg
BEFORE INSERT
ON playercolumns
FOR EACH ROW
EXECUTE PROCEDURE f_tscrec1('tscrec');
So i just want it to insert the trigger now and everytime it inserts a new record run the trigger, its fine on smaller databases but on bigger ones its a disaster. Any ideas, as i said im a newbie to SQL? Im just inserting this via PGadmin in the SQL query tool
This is a postgreSQL database btw but i presume the SQL query is universal?