本文介绍了想要将一列的记录从表复制到同一数据库中的另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在名为'SignOff'的表中有一个名为'SubmittedBySchool'的列。这些列下的记录具有在用户单击网页中的提交按钮时动态输入的日期。现在,我希望将此列下的数据复制到School表中名为DateTravelPlanSubmitted的列中,并且每次用户单击提交按钮时,都必须在列中自动更改数据。任何人都可以帮我完成这项任务。

I have column named as 'SubmittedBySchool' in the table named 'SignOff'. The records under these columns have the date entered dynamically as and when the user clicks on the submit button in the web page. Now I want the data under this column to be copy to the column named 'DateTravelPlanSubmitted' in the table 'School' and also the data must be changed automatically in both the column each time the user clicks on the submit button. Can anyone help me to perform this task.

推荐答案

CREATE TRIGGER Trigger1
   ON  SignOff
   AFTER UPDATE
AS
BEGIN

    Update Schools  SET DateTravelPlanSubmitted = [Your Value]
         from inserted
    WHERE Schools.PremaryKey = inserted.Primarykey

END







请告诉我你有不同的要求然后我理解或者你想了解更多信息。



谢谢

Advay Pandya




Please let me know of you have different requirement then I understood or you want more information.

Thanks
Advay Pandya



这篇关于想要将一列的记录从表复制到同一数据库中的另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 19:25