17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5: Creating and Altering Tables<br />

138<br />

|ADD LOG FILE<br />

([NAME = ,]<br />

FILENAME = <br />

[, SIZE = < size in KB, MB, GB or TB >]<br />

[, MAXSIZE = < size in KB, MB, GB or TB >]<br />

[, FILEGROWTH = ])<br />

|REMOVE FILE [WITH DELETE]<br />

|ADD FILEGROUP <br />

|REMOVE FILEGROUP <br />

|MODIFY FILE <br />

|MODIFY NAME = <br />

|MODIFY FILEGROUP {|NAME =<br />

}<br />

|SET [,...n ][WITH ]<br />

|COLLATE <br />

The reality is that you will very rarely use all that stuff — sometimes I think <strong>Microsoft</strong> just puts it there<br />

for the sole purpose of confusing the heck out of us (just kidding!).<br />

So, after looking at all that gobbledygook, let’s just worry about what we need to expand our database<br />

out to 100MB:<br />

ALTER DATABASE Accounting<br />

MODIFY FILE<br />

(NAME = Accounting,<br />

SIZE = 100MB)<br />

Note that, unlike when we created our database, we don’t get any information about the allocation of<br />

space — instead, we get the rather non-verbose:<br />

The command(s) completed successfully.<br />

Gee — how informative . . . So, we’d better check on things for ourselves:<br />

EXEC sp_helpdb Accounting<br />

Name db_ size Owner dbid Created Status Compatibility_<br />

level<br />

Accounting 105.00<br />

MB<br />

Sa 9 May 28<br />

2005<br />

Status=ONLINE, Update -<br />

ability=READ_WRITE,<br />

UserAccess=MULTI_USER,<br />

Recovery=FULL,<br />

Version=598,<br />

Collation=<strong>SQL</strong>_Latin1_<br />

General_CP1_CI_AS,<br />

<strong>SQL</strong>SortOrder=52,<br />

IsAutoCreate-Statistics,<br />

IsAutoUpdate-<br />

Statistics,<br />

IsFullText-Enabled<br />

90

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!