O'Reilly logo

Microsoft® SQL Server® 2008 Internals by Paul Randal Kalen Delaney Kimberly Tripp, and Conor Cunningham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Altering a Table

SQL Server 2008 allows existing tables to be modified in several ways. Using the ALTER TABLE command, you can make the following types of changes to an existing table:

  • Change the data type or the NULL property of a single column.

  • Add one or more new columns, with or without defining constraints for those columns.

  • Add one or more constraints.

  • Drop one or more constraints.

  • Drop one or more columns.

  • Enable or disable one or more constraints (applies only to CHECK and FOREIGN KEY constraints).

  • Enable or disable one or more triggers.

  • Rebuild a table or a partition to change the compression settings or remove fragmentation. (Fragmentation is discussed in Chapter 6, and compression is discussed in Chapter 7.)

  • Change the lock escalation behavior ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required