Join Simon Allardice for an in-depth discussion in this video Creating default values, part of SQL Server 2008 Essential Training.
- View Offline
- Exercise Files
When you're designing databases, it's a good idea to apply as many rules or…constraints to your data as possible.…And one of the classic ways to do this is by setting up default values for your columns.…The idea of this of course is simple.…We have a table such as an OrderItem table made of product IDs and quantities and unit prices.…Whereas a lot of this information is very different from row to row, Quantity…for example might typically be the number 1. Occasionally it might be 2, but…nine times out of ten or nineteen times out of twenty or ninety-nine out of a…hundred it will be the number 1.…
So we will make this the default value for that column, so it doesn't always…have to be entered, either by the application or by the user.…I'm going to go into my OrderItem table in SQL Server Management Studio and select Design.…Applying a default value is very simple.…Find the column that you're looking for, in this case Quantity, and then…down here in the Column Property section, you'll find a section that says Default Value.…
- Using T-SQL (Transact-SQL)
- Managing databases with SQL Server Management Studio
- Understanding database normalization
- Using SELECT statements
- Building indexes
- Monitoring database size and integrity
- Backing up and restoring databases
- Creating functions and stored procedures
- Managing database permissions
- Creating and formatting reports
- Adding charts to reports
- Creating and executing a simple SSIS package
Skill Level Beginner
1. Getting Started
2. Installing SQL Server 2008 R2
3. Tools and System Databases
SQL Server system databases2m 22s
4. Creating Databases
5. Importing Existing Data
6. Retrieving Data with SQL
7. Inserting and Updating Data
8. SQL Functions
9. Stored Procedures and Transactions
10. Core Administration Tasks
11. Backing Up and Restoring
12. Security Features
13. Reporting Services
14. Integration Services
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.