O'Reilly logo

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

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required