Hi! I would like to know if someone could help. I'm not sure whether to use a trigger or a procedure for the following: in a BUILDING table it has a TOTALASM (ASM - assignable square metres) field which should be calculated by adding the SQMETRES of each room in the ROOM table which corresponds to a particular room. How should I do this? With a trigger or procedure?
Hi! I would like to know if someone could help. I'm not sure whether to use a trigger or a procedure for the following: in a BUILDING table it has a TOTALASM (ASM - assignable square metres) field which should be calculated by adding the SQMETRES of each room in the ROOM table which corresponds to a particular room. How should I do this? With a trigger or procedure?
You want this calculation to happen everytime when a new ROOM record is added? then use trigger.
Create a View by joining the BUILDING and ROOM table and have the calculation done in the view. This view will be getting updated for the corresponding DML operations
thanx guys that worked! i got another question if you guys can help? i'm buidling a front-end for db on mssql 2000. i have made a jdbc odbc connector to my server but when i want to select tables it says that none of them have primery keys but they all do. even in netbeans database explorer it shows that the tables have primary keys! any ideas?
i even tried the example databases that come with ms sql 2000 and netbeans also does not see their primary keys! i've tried also instead to create unique not null fields as the primary keys but with no success!
Sure looks like your table has a primary key to me. So the problem is not with your database, but with net beans. See if there is a net bean forum where people could point you in the right direction.