如何更改日期的触发器 [英] How to make trigger for date changed

查看:106
本文介绍了如何更改日期的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想起了一天的时间段,因为我的数据库中有数据,所以当日期更改时,应该从表&中检索新的想法.进入那个街区.因此,我想为此做些什么,请考虑告诉我如何制作应该每天触发的触发器&;从表&中检索数据将其发送到.aspx页面?
我正在使用Sql Server 2005& VS2008.

其他信息问题:


.aspx页面上有一个小窗口,用于说说今天的生日,是今天的生日,所以我想在aspx页面的那个小窗口中显示思想.
我不想将这种想法发送给每个用户.它是一个普通页面.

Hello ,
I am Making a thought of the day block I have the data in my database so when date changes the new thought should be retrieved from table & come in that block. so what should I do for it I am thinking making trigger for it please tell me how to make trigger that should fire everyday & retrieve data from table & send it to .aspx page?
I am using Sql Server 2005 & VS 2008.

additional infoemation question:


there is a .aspx page on which small say windows are there for news today''s birthday, thought of the day so i want to show thought in that small window in aspx page.
I don''t want to send that thought personally to each user. it''s a common page

推荐答案

如果您的用户正在登录系统,我假设您只想向每个用户显示一次每日想法"天...

在这种情况下,只需让您的aspx页面调用数据库,并传递用户ID和今天的日期...如果用户以前已经收到了当天的想法,则什么都不做,否则将当天的想法显示为用户并将记录插入到您的数据库中以记录用户ID和日期.
If your users are logging into the system, I assume you only want to show each user the "thought of the day" once each day...

In that case, simply have your aspx page make a call to the database passing the userid and today''s date... if the user has previously received the thought of the day, do nothing, otherwise display the thought of the day to the user and insert a record into your database to record the userid and date.


这篇关于如何更改日期的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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