Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sql server 2005 record insertion dates to be found out.

Posted on 2010-11-26
8
Medium Priority
?
410 Views
Last Modified: 2012-06-22
I have a products table in sql server 2005. I have got it from the client. Can i know the date and time when a particular product has been inserted? I have no column like date time in the table. I suppose there should be some in built stored procedure which can tell the date and time when the insertion into the product table for a product was made. this way  I can discover the creation of each products?

can anyone help please?
0
Comment
Question by:Dinesh Kumar
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34216459
no.

unless, as you said, that you have the column ...
or you have the time to compare the full backups of the db of when the record(s) appeared, and eventually then read the archive logs to see the exact time of the inserts ...
0
 

Author Comment

by:Dinesh Kumar
ID: 34216496
I see there is a view which can help i.e select * from sys.dm_db_index_usage_stats
0
 

Author Comment

by:Dinesh Kumar
ID: 34216510
can you explain it little bit more
read the archive logs to see the exact time of the inserts ...
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 168 total points
ID: 34216544
some third-party tools allow to read the transaction logs ...
http://www.sqlmag.com/article/log-files/can-the-transaction-log-tell-us-what-happened-.aspx

lumigent, red gate etc ,...
0
 
LVL 27

Assisted Solution

by:Zberteoc
Zberteoc earned 168 total points
ID: 34217162
The log file approcah would work only if you have all the log files from the moment the database was created. Even so I don't see an easy way to look for each product in multiple log files and beside that I am not sure that yiu have a timestamp in the log file either to show you when a particular insert happened.

Point is what you are asking is quite impossible.

May I ask why do you need this info? Maybe we can find a workaround or even find that is not needed if we would know the reason.

What I could suggest is to add 2 more columns to your table, datecreated and lastupdated and for now set them to the date when you got the backup from your client and make it like a starting point.
0
 

Author Comment

by:Dinesh Kumar
ID: 34217185
The reason is I want to show only those products which are created in last 6 months through a new link added on the website that says New Products.
0
 
LVL 27

Expert Comment

by:Zberteoc
ID: 34217204
Can you ask your client if they can provide even an approximate info about this? It's still better than nothing. After all is their job to know and provide this kind of info, not yours to dig out of nothing. You should tell them and explain why is not possible for you to find it.

Good luck!
0
 
LVL 3

Assisted Solution

by:GSGDBA
GSGDBA earned 164 total points
ID: 34218016
HI,

I suppose you will be able to find some tables with some relationship to each other.
Could you please check the Foreign Keyscolumns referenced from other table to product and product to other tables.

If you are able to see the existence of relationship between tables. Check does those referenced tables have date related column.


.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question