Friday, August 31, 2012

What really is a patch?

A patch is a small release of source code that fixes a specific (and usually critical) issue in a product. Patches are also usually released outside of a normal release cycle due to an urgent issue.

http://stackoverflow.com/questions/2446644/what-really-is-a-patch

Tuesday, August 28, 2012

When was the Table, View, Proc, … created or modified

On my previous blog posts [link] I discussed about System Catalog views and some tips to get the informaion regarding Database objects, like: Tables, Views, etc.
Adding to that post, this post provides the basic information that various DBAs & Developers are interested in, i.e. when was the Table created? or When was that particular Stored Procedure modified or updated?
Following set of queries provides this information:
01select object_id, name, create_date, type_desc, modify_date
02from sys.tables
03UNION
04select object_id, name, create_date, type_desc, modify_date
05from sys.views
06UNION
07select object_id, name, create_date, type_desc, modify_date
08from sys.procedures
09UNION
10select object_id, name, create_date, type_desc, modify_date
11from sys.triggers
-OR- a single query to check all objects information:
1select object_id, name, create_date, type_desc, modify_date
2from sys.all_objects
3where type in ('U''V''P''TR' ,'FN''IF''TF')
4order by type, name
By querying the sys.all_objects view you can also get the information about other DB objects other than listed above, like: Indexes, Constraints, Synonyms, Stats, etc.
MS BOL link on sysobjects and object-type codes: http://msdn.microsoft.com/en-us/library/ms177596.aspx