Join Simon Allardice for an in-depth discussion in this video Creating check constraints, part of SQL Server 2008 Essential Training.
Another way that we can increase the reliability, the integrity of our data, is…to apply what are called check constraints.…A check constraint is a simple idea.…If we have some data such as Quantity where we can look at that and understand…this really unacceptable range for this to be in,…even though this column is actually being defined as an int, we don't need all…that an int can give us.…Because an integer can support from roughly -2 billion to plus 2 billion,…it is quite unlikely that someone will order -2 billion quantities of a unit.…
So let's say I want to enforce some rules on this column that says Quantity must…be greater than 0 and less than 51 say.…Well, I do this by applying a check constraint to the table.…I am going to right-click anywhere in the Designer area.…It really doesn't matter. And I have a section called Check Constraints.…Right now it's saying there are no check constraints on this table.…I am going to add one.…It's typically called CK_ the name of the table.…What we need to type in is an expression.…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.