
Book VIII
Chapter 3
Using SQL
Server 2008
647
The following sections explain how to perform some of the most common
SQL Server chores, such as creating databases and tables, viewing database
data, and so on.
Creating a New Database
To create a new database, follow these steps:
1. Right-click the Databases node in the Navigation pane (on the left side
of the Management Studio window) and choose New Database from
the menu that appears.
This brings up the New Database dialog box, shown in Figure 3-12.
2. Type a name for the new database in the Database Name field.
3. Enter the domain username for the user who is responsible for the
database in the Owner field.
You can leave this set to the default if you want yourself to be listed as
the owner.
4. If you want, change the settings for the database and log files.
You can change the following settings:
• Initial Size: This refers to the amount of disk space initially allocated
to the files. The defaults are a ridiculously small 2MB for the data-
base and 1MB for the log files. Unless your databases are going to be
extremely small, you should probably increase these defaults.
• Autogrowth: This setting sets the incremental amount by which the data-
base grows when it exceeds the allocated capacity. Again, you’ll prob-
ably want to change these amounts for any but the smallest databases.
• Path: This points the way to the folder where the files are stored.
By default, the files are created under the Program Files folder on
the server’s C: drive. You may want to change this setting to a more
appropriate location.
• File Name: You can change this setting if you want to use a filename
that’s different from the database name.
Note that you can change additional options by clicking Options or
Filegroups near the left side of the New Database window. This links
to additional pages of options you can set to tweak the behavior of the
database.
5. Click OK.
SQL Server grinds and whirs for a few moments while it creates the new
database. When it’s finished, the database appears under the Databases
node, as shown in Figure 3-13.
That’s all!
Creating a New Database
60_625873-bk08ch03.indd 64760_625873-bk08ch03.indd 647 9/21/10 10:43 PM9/21/10 10:43 PM