You can create a trigger that fires when inserted into product and inserts a line into lineparameters , for example:
create trigger line_parameter_inserter on products after insert as insert into lineparameters (productId, col1, col2) values (inserted.id, 'foo', 'bar');
but the best option is to create a foreign key from the product table in the default table for groups, so a row must exist in the default table before inserting the product table, for example:
create table lineparameters ( id int, col1 int, ..., primary key (id) ) create table products ( id int, lineparametersId int not null, ... primary key (id), foreign key (lineparametersId) references lineparameters(id) )
This will create a robust process and ensure that even if someone (silently) disables / removes the trigger, you will not have problems with data integrity.
source share