CREATE TRIGGER [Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaLevel=1
From Inserted
Where Inserted.ChaLevel = 250 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Use this if you want to track the number of reborns. Just add the column "ChaReborn" type integer in your ChaInfo Table
CREATE TRIGGER [Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaLevel=1, [ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1
From Inserted
Where Inserted.ChaLevel = 250 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum