473,763 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help regarding finding rows modifeid during certain time frame

Hi guys,

This might be simplest thing, but I am newbie to databases.

I need to find out only rows modified within certain time period from a
database. As I undertand a way out could be adding an where clause for
the time period might be an option, I might be wrong here again.

But, wanted to know is there any other option. Can triggers or any
other things help me in this matter.

Regards,
Abhijeet

Jul 14 '06 #1
1 1434
(ab***********@ gmail.com) writes:
This might be simplest thing, but I am newbie to databases.

I need to find out only rows modified within certain time period from a
database. As I undertand a way out could be adding an where clause for
the time period might be an option, I might be wrong here again.

But, wanted to know is there any other option. Can triggers or any
other things help me in this matter.
First of all, the table(s) need to have a column that reports when
a row was last modified. (Or you need to have full-blown audit table
which tracks all modifications.)

Indeed, a trigger could be used to maintain such a column:
CREATE TRIGGER modified_tri ON tbl FOR INSERT, UPDATE AS
UPDATE tbl
SET last_modified = getdate()
FROM tbl t
WHERE EXISTS (SELECT *
FROM inserted i
WHERE i.keycol = t.keycol)
Once there, the filtering is just one condition in the WHERE clause when
you select.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3764
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
1
1167
by: Ken Kast | last post by:
I have a frameset page with the following code snippets: .. .. .. <script type="text/javascript"> <!-- var bannerFrame; function load () { var bannerDoc = bannerFrame.document;
5
1352
by: Charles Harrison Caudill | last post by:
I've been going through tutorials, APIs, posts on this newsgroup, this newsgroup's faq, etc... I have a function that describes the fields that an object claims to have and I have found what that function reports to often be contradictory to what it will actually respond to. I have seen objects whose toString method returns "" (which Google is unaware of practically btw) return a correct value when I request the "name" field, but even...
9
4529
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in another frame using document.write. My problem is that since chat screen can be obscured by other applications/windows, I have no way of informing users that new messages have arrived other than popping the window to the top using window.focus....
2
1731
by: Ian | last post by:
Can anyone help me with a problem I am having in using FRAMES. I have a web page split into 3 frames as follows: <FRAMESET rows="80,*"> <FRAME frameborder="0" framespacing="0" border="0" src="top.html" name="top" scrolling="no"> <FRAMESET cols="180,*"> <FRAME frameborder="0" framespacing="0" border="0" src="left.php">
18
3042
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How ??
15
4641
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
3
1933
by: shorti | last post by:
db2 v 8.2 on AIX 5.3 I will try to explain as brief as I can what it is I need. I am building a function that will be called multiple times where I will need to return x amount of records each time for the same basic query. I will be basically get passed in where I had left off the last call but it is two fields that make up this unique index. The main rule is that I cannot hold open a cursor on the record I last read because it...
6
1949
by: Richard Maher | last post by:
Hi, Now that I am aware that JS on a page in Frame A can directly call a function on a page in Frame B, I no longer have to continue with my frameB.location.reload() fudge in order to get some code to run in B's context. This is fantastic news, and I'm having a ball! But before running off with all my convert's zeal and converting all my <script src="common.js"copy-books to direct parent.frame.function() calls I'd like to pause for a...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.