One of the popular questions is when was any object or table created in the database. Well, the answer is very straightforward and easy and I often discuss this during Comprehensive Database Performance Health Check. Let us learn about how to Identify Table Creation Date from Traces.
Just run the following script:
SELECT PATH, Trace.* FROM sys.traces AS T CROSS APPLY fn_trace_gettable(T.path, DEFAULT) as Trace WHERE ObjectName LIKE '%YourTableNameorAnyotherObject%';
The script will give you the date, time and various other details about who created the object.
If you have a default trace enable in your system, you can get lots of information very quickly and easily. However, there is bad news as well. Microsoft has decided to discontinue the default trace and advises everyone to use Extended Events instead of it.
Now if you ask me, I am a big fan of the extended event and it works great most of the time. However, default trace was a very simple and easy solution, which one could have to get going very quickly and easily.
I hope you learned today about how to Identify Table Creation Date from Traces. Here are some of the relevant blog posts on MongoDB.
- Foundations of Document Databases with MongoDB – Video Course
- SQL Terms vs MongoDB Terms
- MongoDB Compass – Missing a Schema Section
Reach out to me on Twitter and we can talk more about it.
Reference: Pinal Dave (http://blog.SQLAuthority.com)