SQL: Min and Max value for each DATETIME field in a database

The script below outputs a list of each DATETIME and SMALLDATETIME field within a database, along with the minimum and maximum values.

I used this script to check to see if an old legacy database was still being used 1

  1. Please ensure you test any script taken from my website on a test/development machine, before running on a production server.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

CJayMead's SQL Server, Endeca, MS Office Help © 2018