Managing Databases Using T-SQL

This section teaches you how to create, alter, and drop databases. The results of these T-SQL operations are the same as what you achieved using the SQL Database UI. The syntax will be familiar to you from your experience with standard SQL Server, although the options available are more restricted.

When you created your SQL Database server, the master system database was also generated for you. Whenever you execute a CREATE, ALTER, or DROP DATABASE command in T-SQL, as explained in the following examples, you must do so while in the context of master.

Creating Databases

When you create a database using T-SQL, it defaults to SQL Database Web edition with a size of 1GB. You can, however, specify maximum size and ...

Get Microsoft® SQL Server 2012 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.