Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Trigger that set a value to the inserted record

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-02 : 07:19:18
RayABC writes "I want to create a trigger that allow a value to be automatically set to the inserted records.
i.e: I have Table1 with 3 columns.
During insertion, only col 1 and 2 are populated by user,
while col 3 should be set automatically with a value selected from another table via trigger (select sum(duration) from Table2 where Table1.Col1=Table2.SerNum)).
Any idea?"

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-06-02 : 09:35:26
Search here for examples of INSERT/UPDATE trigger....you should be able (with a bit of applied mental effort)....to come up with a solution....
Go to Top of Page
   

- Advertisement -