You are previewing Beginning SQL Server 2012 for Developers.
O'Reilly logo
Beginning SQL Server 2012 for Developers

Book Description

Beginning SQL Server 2012 for Developers is the perfect book for developers new to SQL Server and planning to create and deploy applications against Microsoft's market-leading database system for the Windows platform. Now in its third edition, the book is enhanced to cover the very latest developments in SQL Server 2012.

Also new in the book is coverage of the no-cost Express Edition. Whether you have no knowledge of databases, or have knowledge of desktop databases such as Microsoft Access, or even come from another brand such as Oracle Database, Beginning SQL Server 2012 for Developers provides the insights to get up and running with SQL Server 2012.

Within the book, there are plenty of examples of tasks that developers routinely perform. You'll learn to create tables and indexes, and best practices for securing your valuable data. You'll learn design tradeoffs and find out how to make sound decisions resulting in scalable databases and maintainable code.

Beginning SQL Server 2012 for Developers takes you through the entire database development process, from installing the software to creating a database to writing the code to connect to that database and move data in and out. By the end of the book, you'll be able to design and create solid and reliable database solutions using SQL Server 2012.

  • Takes you through the entire database application development lifecycle

  • Includes brand new coverage of SQL Server 2012 features

  • Introduces the freely-available Express Edition

Table of Contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Introduction
  9. CHAPTER 1: Overview and Installation
    1. Why SQL Server 2012?
    2. Evolution of SQL Server
    3. Hardware Requirements
    4. The Example
    5. Installation
    6. Security
    7. Summary
  10. CHAPTER 2: SQL Server Management Studio
    1. A Quick Overview of SSMS
    2. Query Editor
    3. Summary
  11. CHAPTER 3: Database Design and Creation
    1. Defining a Database
    2. Prebuilt Databases Within SQL Server
    3. Choosing the Database System Type
    4. Gathering the Data
    5. Determining the Information to Store in the Database
    6. External and Ignored Information
    7. Building Relationships
    8. Normalization
    9. Creating the Sample Database
    10. Summary
  12. CHAPTER 4: Security and Compliance
    1. Logins
    2. Server Logins and Database Users
    3. Roles
    4. Schemas
    5. Before You Can Proceed with Your Solution
    6. Declarative Management Framework
    7. Summary
  13. CHAPTER 5: Defining Tables
    1. What Is a Table?
    2. SQL Server Data Types
    3. Columns As More Than Simple Data Repositories
    4. Creating a Table in SQL Server Management Studio
    5. Creating a Table Through Query Editor
    6. Creating a Table: Using a Template
    7. Creating and Altering a Template
    8. The ALTER TABLE Statement
    9. Defining the Remaining Tables
    10. Setting a Primary Key
    11. Creating a Relationship
    12. Building a Relationship via T-SQL
    13. Relationships: Database or Application
    14. Summary
  14. CHAPTER 6: Creating Indexes and Database Diagramming
    1. What Is an Index?
    2. Determining What Makes a Good Index
    3. Determining What Makes a Bad Index
    4. Reviewing Your Indexes for Performance
    5. Creating an Index
    6. Dropping an Index
    7. Altering an Index
    8. When an Index Does Not Exist
    9. Diagramming the Database
    10. Summary
  15. CHAPTER 7: Database Backups and Recovery
    1. Backup Strategies
    2. Transaction Logs
    3. When Problems May Occur
    4. Backups: Taking a Database Offline
    5. Backing Up the Data
    6. Restoring a Database
    7. Detaching and Attaching a Database
    8. Producing SQL Script for the Database
    9. Summary
  16. CHAPTER 8: Database Maintenance
    1. Creating a Database Maintenance Plan
    2. Executing the Plan
    3. Setting Up Database Mail
    4. Modifying a Maintenance Plan
    5. Summary
  17. CHAPTER 9: Data Insertion, Deletion, and Transactions
    1. Inserting Data
    2. Transactions
    3. Deleting Data
    4. Summary
  18. CHAPTER 10: Selecting and Updating Data
    1. Retrieving Data
    2. Limiting a Search: The Use of WHERE
    3. String Functions
    4. Order! Order!
    5. The LIKE Operator
    6. Creating Data: SELECT INTO
    7. Updating Data
    8. Using More Than One Table
    9. Summary
  19. CHAPTER 11: Building a View
    1. Why a View?
    2. Creating a View: SQL Server Management Studio
    3. Creating a View Using a View
    4. Creating a View Using T-SQL Syntax
    5. Indexing a View
    6. Summary
  20. CHAPTER 12: Stored Procedures, Functions, and Security
    1. What Is a Stored Procedure?
    2. Creating a Stored Procedure
    3. Returning Results
    4. Controlling the Flow
    5. Bringing It All Together
    6. Security
    7. User-Defined Functions
    8. Summary
  21. CHAPTER 13: Essentials for Effective Coding
    1. Variables
    2. Temporary Tables
    3. Aggregations
    4. Grouping Data
    5. HAVING
    6. Distinct Values
    7. Functions
    9. Error Handling
    10. Summary
  22. CHAPTER 14: Advanced T-SQL and Debugging
    1. Sequences Instead of IDENTITY
    2. Creating a SEQUENCE
    3. Subqueries
    4. The APPLY Operator
    5. Common Table Expressions
    6. Pivoting Data
    7. Ranking Functions
    8. Cursors
    9. Debugging Your Code
    10. Summary
  23. CHAPTER 15: Triggers
    1. What Is a Trigger?
    2. The DML Trigger
    3. DDL Triggers
    4. Summary
  24. CHAPTER 16: Connecting via Code
    1. General Application Security
    2. Connecting with Excel or Excel Visual Basic for Applications (VBA)
    3. Visual Studio
    4. Java
    5. Summary
  25. Index