Apress Beginning SQL Server 2012 for Developers 3rd (2012).pdf

(18495 KB) Pobierz
939601787.006.png
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
939601787.007.png 939601787.008.png
Contents at a Glance
About the Author................................................................................................. xvii
About the Technical Reviewer........................................................................... xviii
Acknowledgments............................................................................................... xix
Introduction..........................................................................................................xx
Chapter 1: Overview and Installation..................................................................... 1
Chapter 2: SQL Server Management Studio.......................................................... 31
Chapter 3: Database Design and Creation............................................................ 51
Chapter 4: Security and Compliance.................................................................. 101
Chapter 5: Defining Tables.................................................................................. 139
Chapter 6: Creating Indexes and Database Diagramming.................................. 187
Chapter 7: Database Backups and Recovery...................................................... 223
Chapter 8: Database Maintenance...................................................................... 289
Chapter 9: Data Insertion, Deletion, and Transactions....................................... 333
Chapter 10: Selecting and Updating Data........................................................... 367
Chapter 11: Building a View................................................................................ 417
Chapter 12: Stored Procedures, Functions, and Security................................... 445
Chapter 13: Essentials for Effective Coding........................................................ 493
Chapter 14: Advanced T-SQL and Debugging..................................................... 547
Chapter 15: Triggers........................................................................................... 593
Chapter 16: Connecting via Code........................................................................ 619
Index................................................................................................................... 679
iv
939601787.009.png 939601787.001.png 939601787.002.png 939601787.003.png
Introduction
Beginning SQL Server 2012 for Developers is for those people who see themselves as becoming either
developers, database administrators, or a mixture of both but have yet to tread that path with SQL Server
2012. This edition of my book is for readers who wish to learn and develop on the free version of SQL
Server 2012, SQL Server 2012 Express, or either the trial or licensed versions of SQL Server 2012.
Whether you have no knowledge of databases, or have knowledge of desktop databases such as
MS Access, or even come from a server-based background such as Oracle, this book will provide you
with the insight to get up and running with SQL Server 2012.
Right from the start, your basic knowledge will be expanded, and you will soon be moving from
a perceived beginner through to a competent and professional developer. It is the aim of this book to
cater to a wide range of developers, from those who prefer to use the graphical interface for as much
work as possible to those who want to become more adept at using the SQL Server 2012 programming
language, T-SQL. Where practical, each method of using SQL Server 2012 is demonstrated, explained,
and expanded so that you can evaluate what works best in your situation. You will also find a chapter on
how to work with using Excel, .NET, and Java and incorporate them with T-SQL.
There are plenty of examples within the book of every action along with details about the
security of your data. You will also learn the best way to complete a task and even how to make the
correct decision when there are two or more choices that could be made.
Once you reach the end of this book, you will be able to design and create solid and reliable
database solutions competently and proficiently.
xx
939601787.004.png
C H A P T E R 1
Overview and Installation
Welcome to Beginning SQL Server 2012 for Developers . This book has been written for those who are
interested in learning how to create solutions with Microsoft SQL Server 2012, but have no prior
knowledge of SQL Server 2012. You may well have had exposure to other database management systems
(DBMSs), such as MySQL, Oracle, or Microsoft Access, but SQL Server uses different interfaces and has a
different way of working compared to much of the competition. The aim of this book is to bring you
quickly up to a level at which you are developing competently with SQL Server 2012. This book is
specifically dedicated to beginners and to those who at this stage wish to use only SQL Server 2012. You
may find this book useful for understanding the basics of other database management systems in the
marketplace, especially when working with T-SQL. Many DBMSs use an ANSI-standard SQL, so moving
from SQL Server to Oracle, Sybase, etc. after reading this book will be a great deal easier.
This chapter covers the following topics:
Why SQL Server 2012?
How do I know whether my hardware meets the requirements?
Can I just confirm that I have the right operating system?
What can I do with SQL Server 2012?
You will also then look at installing your chosen edition and cover the following:
Installing SQL Server 2012 on a Windows 7 platform
Options not installed by default
Where to install SQL Server physically
Multiple installations on one computer
How SQL Server runs on a machine
How security is implemented
Logon IDs for SQL Server, especially the sa (system administrator) logon
Why SQL Server 2012?
The following discussion is my point of view, and although it no doubt differs from that of others, the
basis of the discussion holds true. SQL Server faces competition from other database management
1
939601787.005.png
Zgłoś jeśli naruszono regulamin