Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mark8080
Starting Member
5 Posts |
Posted - 2008-12-04 : 21:54:07
|
I want to pull data from database at regular interval of 20 minutes.The database gets data inserted in Table in real time. So each interval new data will be available to read plus existing old data read before.How can I make sure, I can begin from raw last time accessed till end of database at each 20 min?Thanks,Mark |
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2008-12-05 : 03:26:09
|
Why u Donn use Job Scheduler to do this task,,,,,You Just make a store procedure to throw or backup the data from ur orignal database and then Schedule a Job On The iNterval of 20 mins 4 This....Thanks...\U Can Find Job Scheduler in Enterprise Manager >> Management >> SQL Server Agent >> Jobs |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-05 : 10:27:50
|
Do you have Timestamp column to identify ? |
 |
|
Mark8080
Starting Member
5 Posts |
Posted - 2008-12-05 : 10:52:45
|
I want to write a SQL to do this task. I don't know about job scheduler. Note I am sync table of two different types of database.I have timestamp column. But that could not gurantee the last column. If last pull was at 12:30. I can't begin at 12:31, as when last time pulled at 12:30, so data insertion might be in process also. |
 |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-12-05 : 11:55:09
|
There are several ways to do this. Some way are to:1. Put a DATETIME column (or columns) to indicate when the row was Modified or Created/Changed and use that time to figure out which rows to get (by looking at the MAX in your destination table).2. (As SoDeep Suggested) you can put a TIMESTAMP (or ROWVERSION) on the source table and then just grab everything in the source table that is greater than the MAX in the destination table.3. You can use replication.4. You can use triggers.5. etc.. |
 |
|
|
|
|