Solved

sql server 2005 record insertion dates to be found out.

Posted on 2010-11-26
8
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 42 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 42 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 41 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

ClickHouse in a General Analytical Workload

We have mentioned ClickHouse in some recent posts, where it showed excellent results.

In this article on Experts Exchange, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

623 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