Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Determining when rows were inserted into a table
Old 03-13-2008, 08: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
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
rungss is offline
Reply With Quote
View Public Profile Visit rungss's homepage!
 
 
Register now for full access!
Old 03-13-2008, 04: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,662
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 04:32 PM Re: Determining when rows were inserted into a table
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-15-2008, 12:39 AM 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....
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
rungss is offline
Reply With Quote
View Public Profile Visit rungss's homepage!
 
Old 03-18-2008, 09:35 PM Re: Determining when rows were inserted into a table
joder's Avatar
Flipotron

Posts: 6,442
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, 07: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,662
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().
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
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.16739 seconds with 12 queries