ptg
Database Files. ............................................................................................711
Primary Files ......................................................................................712
Secondary Files ..................................................................................712
Using Filegroups ................................................................................713
Using Partitions .................................................................................716
Transaction Log Files .........................................................................716
Creating Databases. ....................................................................................717
Using SSMS to Create a Database......................................................718
Using T-SQL to Create Databases . ....................................................721
Setting Database Options. ..........................................................................722
The Database Options .......................................................................723
Using T-SQL to Set Database Options ...............................................725
Retrieving Option Information .........................................................726
Managing Databases . .................................................................................729
Managing File Growth.......................................................................729
Expanding Databases.........................................................................730
Shrinking Databases ..........................................................................731
Moving Databases. ............................................................................736
Restoring a Database Backup to a New Location..............................736
Using ALTER DATABASE....................................................................736
Detaching and Attaching Databases .................................................737
Summary .....................................................................................................740
24 Creating and Managing Tables
741
What’s New in SQL Server 2008.................................................................741
Creating Tables. ..........................................................................................742
Using Object Explorer to Create Tables ............................................742
Using Database Diagrams to Create Tables. .....................................743
Using T-SQL to Create Tables . ..........................................................744
Defining Columns ......................................................................................747
Data Types..........................................................................................747
Column Properties. ...........................................................................755
Defining Table Location .............................................................................761
Defining Table Constraints.........................................................................763
Modifying Tables. .......................................................................................765
Using T-SQL to Modify Tables...........................................................766
Using Object Explorer and the Table Designer to Modify Tables.....769
Using Database Diagrams to Modify Tables......................................772
Dropping Tables ..........................................................................................773
Using Partitioned Tables .............................................................................774
Creating a Partition Function ...........................................................776
Creating a Partition Scheme..............................................................778
Creating a Partitioned Table. ............................................................779
Contents
xix
Download from www.wowebook.com