Join Simon Allardice for an in-depth discussion in this video Creating unique constraints, part of SQL Server 2008 Essential Training.
Another kind of constraint you can work with is what's called a unique constraint.…Now in fact, we already have one of these on most of our tables.…If you have a primary key, you have a unique constraint. That primary key…cannot be duplicated.…In this case, there can only be one ProductID with 1008 in it.…But occasionally, you will want to define another column as being a unique…constraint, that the value cannot occur more than once in the entirety of the…column in that table.…
Now right now none of these columns should be made unique.…Certainly not UnitsInStock and certainly not Color. That repeats quite a lot.…We might have ProductName made unique, but not the way that we work with it.…For example, I have a Road-650 58 in Black and I have a Road-650 58 product in…Red and a Road-650 58 product in Green.…I can't make ProductName unique.…What would be interesting, however, is if I could force uniqueness on a…combination of the two.…
What that allows me to do is make sure that they aren't accidentally two rows…
- 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.