Chapter 16 -- Creating and Using Defaults, Constraints, and Rules

3 4

Chapter 16

Defaults, constraints, and rules are optional attributes that you can define on database columns and tables. Chapter 15 showed you a little bit about defaults by describing how to add a column with a default value to a table by using the ALTER TABLE command. In this chapter, you'll learn the two methods for creating and modifying defaults. As you'll recall, defaults are values inserted into a particular column when no value is explicitly entered. Constraints provide methods for identifying valid values for a column (in order to reject invalid values) and for enforcing data integrity within database tables and between related tables. We'll look at the five types of constraints in this chapter, and you'll learn how to create and modify defaults and constraints by using both Transact-SQL (T-SQL) and Microsoft SQL Server Enterprise Manager, although using Enterprise Manager is often simpler.



Microsoft SQL Server 2000 Administrator's Companion
Microsoft SQL Server 2000 Administrators Companion
ISBN: B001HC0RPI
EAN: N/A
Year: 2005
Pages: 264

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net