Solved

sql server 2005 record insertion dates to be found out.

Posted on 2010-11-26
8
406 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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…

752 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