From the course: Microsoft SQL Server 2019 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understand data types

Understand data types - SQL Server Tutorial

From the course: Microsoft SQL Server 2019 Essential Training

Start my 1-month free trial

Understand data types

- [Instructor] Having a good solid understanding of SQL Server's data types will make it easier for you to select the best option for your data storage needs when constructing your database's tables. I've touched on the topic briefly, but we need to explore this concept in more detail. First, let's make sure that we're all on the same page as to why we need to properly define the types of data that each column will store. One of the main reasons is to be efficient with storage space. If, for example, you need to store a number that represents an employee's age in years, you can pretty confidently assume that under no conceivable situation will that number ever need to be more than 255. SQL Server will allow you to store that value using a data type called tinyint, and it'll take a total of one byte of storage space on your disk to do so for every employee. If you incorrectly type the same age column as a regular int, or an integer data type, that same data storage will quadruple and…

Contents