How to get Min and Max Length for each Column Values for all the tables in SQL Server

In this post we will see how to find minimum and maximum length for each columns for all the tables in SQL Server.

Choosing Data Types 

Choosing a poor data type can have a significant impact on the database design and performance. Developers and DBAs can improve database performance by understanding the data types supported by SQL Server and the implications of choosing different ones. A best practice is to “right size” data types by asking business questions and determining the data types that are best suited to the organization’s and application’s needs.

Temporal Tables in SQL Server 2016


SQL Server 2016 has introduced a new type of a table that allows full tracking of any changes that the primary table has undergone. It does this by creating a separate 'linked' table called a history table that records all modifications.The great benefit is that it allows the dba to know the state of the data at any point in time.Previously, if we needed to track changes to the table, the developer needed to create triggers and store the data in separate table. A time consuming task.