澳门新萄京论坛楼层总括触发器

USE suya_devGOIF EXISTS(  SELECT *  FROM sys.triggers  WHERE name = N'BBS_Post_before_insert')  DROP TRIGGER BBS_Post_before_insert GOCREATE TRIGGER BBS_Post_before_insert   ON BBS_Post  FOR insertAS BEGIN  declare @Id int  declare @TopicId int  declare @Floor int  select @Id = Id from inserted  select @TopicId = TopicId from inserted  select @Floor = count(1) from BBS_Post where TopicId=@TopicId  update BBS_Post set Floor=@Floor where Id=@IdENDGO

澳门新萄京 1澳门新萄京 2

View Code

代码:

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图