Sometimes you need to know more information about various data types supports by your SQL Server version. Information like if the specific data type is searchable or not, or it’s maximum precision, or if it’s case sensitive or not. sp_datatype_info system SP comes handy to retrieve such information.
EXECsp_msforeachdb'USE ?; IF EXISTS(SELECT 1 FROM [?].sys.objects WHERE name=''<<SP NAME>>'') PRINT DB_NAME() '-- Example:
EXECsp_msforeachdb'USE ?; IF EXISTS(SELECT 1 FROM [?].sys.objects WHERE name=''usp_CommentTree'') PRINT DB_NAME() '
Sometimes it always helps to get the list of all modified tables or stored procedures before check-in the code or wrapping up the development for the build. Some developers usually keep this kind list in a file and they update this file every time they modify any table or stored procedure in their development environment. Following are some handy SQL snippets which can provide you list of the tables, or stored procedure modified in the specified duration.