Solved

sql server 2005 record insertion dates to be found out.

Posted on 2010-11-26
8
401 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 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
Comment Utility
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
Comment Utility
can you explain it little bit more
read the archive logs to see the exact time of the inserts ...
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 42 total points
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 26

Assisted Solution

by:Zberteoc
Zberteoc earned 42 total points
Comment Utility
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
Comment Utility
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 26

Expert Comment

by:Zberteoc
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now