Reply
Determining when rows were inserted into a table
Old 03-13-2008, 07:43 AM Determining when rows were inserted into a table
rungss's Avatar
Skilled Talker

Posts: 67
Name: Bijay Rungta
Location: Mumbai, India
Trades: 0
Is there a way to determine when a particular row was inserted into a table in a Database.

I have an old system which we are redeveloping.

Unfortunately the previous database didin't have a field for date_created or something like that to log the time an entry was created.

Is there a way to find the time a row was inserted/created for each row by using Server logs or Information Scema or any other way???

Thanks,
Bijay
__________________
My Blog
My Home Page
rungss is offline
Reply With Quote
View Public Profile Visit rungss's homepage!
 
 
When You Register, These Ads Go Away!
Old 03-13-2008, 03:19 PM Re: Determining when rows were inserted into a table
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,674
Name: John Alexander
Trades: 0
No.

I don't know how many rows your table has, but no database engine I'm aware of keeps secret hidden audit log tables to mimic user tables so this type of question could be answered. Imagine how much that would slow performance! Sometimes it would be worth the cost and other times it wouldn't - they let us decide for ourselves by giving us the opportunity to keep a insertedDT column if we choose to.

Sorry.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 03:32 PM Re: Determining when rows were inserted into a table
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,942
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
What John said. It's not really something that's tracked, by default.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-14-2008, 11:39 PM Re: Determining when rows were inserted into a table
rungss's Avatar
Skilled Talker

Posts: 67
Name: Bijay Rungta
Location: Mumbai, India
Trades: 0
hmmm...
Yeah I was just wondering if there is any way to determine it from the log that the MySQL Engine maintains.. Even if it does it won't keep the log for years I guess...

But still I want to believe there is a way...

High Hopes....
__________________
My Blog
My Home Page
rungss is offline
Reply With Quote
View Public Profile Visit rungss's homepage!
 
Old 03-18-2008, 08:35 PM Re: Determining when rows were inserted into a table
joder's Avatar
Flipotron

Posts: 6,441
Name: James
Location: In the ocean.
Trades: 0
Not unless you had the general query log turned on. Probably wasn't since it would take up huge amounts of space.
joder is offline
Reply With Quote
View Public Profile
 
Old 03-19-2008, 06:47 PM Re: Determining when rows were inserted into a table
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,674
Name: John Alexander
Trades: 0
Quote:
Originally Posted by rungss View Post
But still I want to believe there is a way...
Sam gave me some money, and then Sally gave me some money. Now I have $50. How much did Sam give me?

Finding when a particular row was inserted into your database table if you don't record that is as impossible as answering the question above. RDBMS engines don't store data unless you ask them to. The amount of potential metadata that could be stored will always amount to a great deal more than the real data you actually store.

The way to get this information going forward would be to add a RowCreated date column and default it to GetDate().
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Determining when rows were inserted into a table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10024 seconds with 13 queries