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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Name Fileid Filename Filegroup<br />

Accounting 1 c:\<br />

Program<br />

Files\<br />

<strong>Microsoft</strong><br />

<strong>SQL</strong> <strong>Server</strong>\<br />

MS<strong>SQL</strong>10<br />

.MS<strong>SQL</strong>SERVER<br />

\MS<strong>SQL</strong>\DATA<br />

\Accounting-<br />

Data.mdf<br />

AccountingLog 2 c:\<br />

Program<br />

Files\<br />

<strong>Microsoft</strong><br />

<strong>SQL</strong> <strong>Server</strong>\<br />

MS<strong>SQL</strong>10<br />

.MS<strong>SQL</strong>SERVER<br />

\MS<strong>SQL</strong>\DATA<br />

\Accounting-<br />

Log.ldf<br />

Things pretty much work the same for any of the more common database-level modifications you’ll<br />

make. The permutations are, however, endless. The more complex filegroup modifications and the like<br />

are outside the scope of this book, but, if you need more information on them, I would recommend one<br />

of the more administrator-oriented books out there (and there are a ton of them).<br />

Option and Termination Specs<br />

Chapter 5: Creating and Altering Tables<br />

PRIMARY 10240<br />

0 KB<br />

NULL 5120<br />

KB<br />

Size Maxsize Growth Usage<br />

102400<br />

KB<br />

25600<br />

KB<br />

5120<br />

KB<br />

5120<br />

KB<br />

data<br />

only<br />

log<br />

only<br />

<strong>SQL</strong> <strong>Server</strong> has a few options that can be set with an ALTER DATABASE statement. Among these are database-specific<br />

defaults for most of the SET options that are available (such as ANSI_PADDING, ARITHABORT —<br />

handy if you’re dealing with indexed or partitioned views), state options (for example, single user mode<br />

or read-only), and recovery options. The effects of the various SET options are discussed where they are<br />

relevant throughout the book. This new ALTER functionality simply gives you an additional way to<br />

change the defaults for any particular database.<br />

<strong>SQL</strong> <strong>Server</strong> also has the ability to control the implementation of some of the changes you are trying to<br />

make on your database. Many changes require that you have exclusive control over the database —<br />

something that can be hard to deal with if other users are already in the system. <strong>SQL</strong> <strong>Server</strong> gives us the<br />

ability to gracefully force other users out of the database so that we may complete our database changes.<br />

The strength of these actions ranges from waiting a number of seconds (you decide how long) before<br />

kicking other users out, all the way up to immediate termination of any option transactions (automatically<br />

rolling them back). Relatively uncontrolled (from the client’s perspective) termination of transactions is<br />

139

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

Saved successfully!

Ooh no, something went wrong!