As business systems become more intricate, so does the T-SQL development needed to get at that data. In this course we’ll discuss some of the challenges facing developers including complex data types and structures; the “art” of writing efficient queries; and how to tackle and simplify multi-step processes. First we’ll discuss data types, implicit and explicit conversion, and precedence. Next, we’ll move on to discuss working with multinational data and understanding collation—which are SQL Server’s rules for sorting and comparing strings. We’ll discuss working with and storing hierarchical data using the hierarchyid data type. Next you’ll learn that even little things make a difference. We’ll explore how to boost data operations by using JOINs rather than subqueries, and how to check for inclusion using EXISTS. We’ll finish up by discussing temporary tables, table variables, user-defined table-valued functions, CTEs, worktables, and user-defined table type parameters. I’ll show you how using implicit transactions can help in the debugging process and why keeping things simple usually makes the most sense.
This course assumes that you have a basic familiarity with the concept of relational databases and a basic understanding of what SQL Server is and the high-level tools in it, as well as how to create and manage objects using Management Studio. You should also have a basic understanding of how SQL Server implements security, including its authentication and authorization schemes, and how to assign permissions on securable objects to principals. You should know the fundamentals of Transact-SQL to write queries to retrieve and update data, and how to execute scripts using the query editor in Management Studio. It will be very helpful, but not absolutely necessary, to have experience with .NET development using Visual Studio 2010 or 2012 for the portions of the course that deal with SQLCLR development. The .NET code included in this course is written in C#, but if you prefer Visual Basic it should be fairly easy to convert the code.