|
Posted by Martijn Tonies on 11/07/06 15:37
Hi,
> i have a table and if a record is inserted i will test a numeric value
> in this table. If the this value is greather as 1 million, than an
> status column should be changed from 'A' to 'B'.
>
> Yes and sorry, this is a newbie question.
>
> On Oracle this work simple:
>
> create trigger myTrigger on tableX
> as
> begin
> if :old.x > 100000 then
> :new.y:='B'
> end if;
> end;
MS SQL Server doesn't have "before action" triggers, so you
have to update the table and use the INSERTED virtual table
to know what records were inserted into the table.
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Navigation:
[Reply to this message]
|