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 2008 Forums
 Transact-SQL (2008)
 creating a trigger

Author  Topic 

melaniepaes
Starting Member

1 Post

Posted - 2009-10-04 : 21:43:15
i need to create an update trigger and i have 2 tables MEGA and update_count. update_count has a single row and single column and the value is set to 0. Every time a row in Mega is changed you should update the value in UPDATE_COUNT itself, adding 1 to it.

can you please tell me how this is to be done?

table name
MEGA
number1 number2 number3 number4 number5 meganumber payout
15 24 51 53 55 11 0

i also need to test the trigger in this manner
update MEGA
set NUMBER1 = 0
where NUMBER1 = 1

update MEGA
set NUMBER1 = 0
where NUMBER1 = 2

update MEGA
set NUMBER1 = 0
where NUMBER1 = 3

Show UPDATE_COUNT before and after each update.
   

- Advertisement -