From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 24,100 courses taught by industry experts.

Establish a default value

Establish a default value

- In order to speed up data entry in your tables you can specify a default value that will appear in a column when no value is supplied. This way, you can simply skip over that field to accept the default or change it if it needs to be something different. For the Red30 Tech database, we found that most of our newer products are going to be in the ebooks category, so I want that to be the default value that'll get suggested when entering in new products. To make this change find the products table in the Red30 Tech database, right click on it and open up the design window. Then with the category column selected, take a look in the properties at the bottom of the screen and find the default value or binding property. Here I'll type in the value that we want to be supplied automatically, ebooks. When I press enter SQL Server wraps this in single quotation marks, which indicates that this is a text string. It also…

Contents