SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond
by Tom Carpenter
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.
Read now
Unlock full access