Skip to Content
SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond
book

SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond

by Tom Carpenter
May 2010
Intermediate to advanced
815 pages
21h 55m
English
Sybex
Content preview from SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond

Creating Databases with T-SQL

Creating databases with Transact-SQL (T-SQL) is a bit more complicated. You will need to understand the syntax of the CREATE DATABASE statement before you begin. However, you can learn the syntax easily by using the GUI New Database interface that you used in Exercise 8.1 to set up the new database. Then, instead of clicking OK to create the database, as you did in step 9, you can click the Script button to generate a T-SQL script that would create the database for you. Figure 8.6 shows the Script button's options, and Figure 8.7 shows the very script that would be created for the Books database created in Exercise 8.1.

FIGURE 8.6 The Script button's options used to generate T-SQL scripts

FIGURE 8.7 The automatic ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft SQL Server 2012 Administration: Real-World Skills for MCSA Certification and Beyond (Exams 70-461, 70-462, and 70-463)

Microsoft SQL Server 2012 Administration: Real-World Skills for MCSA Certification and Beyond (Exams 70-461, 70-462, and 70-463)

Tom Carpenter
Microsoft® SQL Server™ 2005 Administrator's Companion

Microsoft® SQL Server™ 2005 Administrator's Companion

Edward Whalen, Marcilina Garcia, Burzin Patel, Stacia Misner, Victor Isakov

Publisher Resources

ISBN: 9780470554203Purchase book