在SQL Server 2008中创建触发器 [英] Create trigger in SQL server 2008

查看:131
本文介绍了在SQL Server 2008中创建触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建两个表的触发器







我想为两个表创建触发器

我的表是子评论和子评论

我的要求是

当我将数据插入子项目表然后子项表更新时使用新数据并插入旧记录进入子评论表。

然后

子表维护单个更新记录

和子命名表维护子记录表的旧记录





SHOUTING删除 - OriginalGriff [/ edit]

I want create trigger for two tables



I want create trigger for two tables
my tables are subcomment and subcommenthistory
my requirement is
when I insert the data into subcomment table then subcomment table is update with new data and insert old records into subcommenthitory table.
then
subcomment table maintain single updated record
and subcommen table maintain old records of subcomment table


[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案





您的问题本身并不清楚。

但是,有很多关于如何使用和编码触发器的在线文本。 />
ex:触发器 - Sql Server [ ^ ]



浏览CodeProject和MSDN,您将获得所需的一切。

另外你会发布你的代码,这里的人们可以进一步提供帮助。



-Anurag
Hi,

Your question itself is not clear.
However, there are plenty of online texts available on how to use and code triggers.
ex:Triggers -- Sql Server[^]

Browse CodeProject and MSDN, you will get what all you need.
Also you would wana post your code, folks here will be able to help further.

-Anurag


这篇关于在SQL Server 2008中创建触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆