Inside Microsoft® SQL ServerTM 2005 T-SQL Programming

Get a detailed look at the internal architecture of T-SQL with this comprehensive programming reference. Database developers and administrators get best practices, expert techniques, and code samples to master the intricacies of the programming language-solving complex problems with real-world solu...

Descripción completa

Detalles Bibliográficos
Autor principal: Sarka, Dejan (-)
Otros Autores: Ben-Gan, Itzik, Kollar, Lubor
Formato: Libro electrónico
Idioma:Inglés
Publicado: Sebastopol : Microsoft Press 2009.
Edición:1st edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627163106719
Tabla de Contenidos:
  • Inside Microsoft® SQL ServerTM 2005: T-SQL Programming; Preface; Acknowledgments; Introduction; System Requirements; Installing Sample Databases; Updates; Code Samples; Support for This Book; 1. Datatype-Related Problems, XML, and CLR UDTs; Datetime Manipulation; Rounding Issues; DATETIME Functions; No Separation Between Date and Time; Datetime-Related Querying Problems; Overlaps; Grouping Overlaps; Maximum Number of Overlapping Sessions (Set-Based Solution); Identifying Weekday; Grouping by the Week; ISO Week; Working Days; Generating a Series of Dates; Character-Related Problems
  • Case-Sensitive FiltersLarge Objects; BULK Rowset Provider; Implicit Conversions; Filter Expressions; CLR-Based User-Defined Types; Relations and Classes; Domains and Classes; Complex Domains; Why Do We Need Complex Classes?; Language for Creating UDTs; Programming a UDT; Creating a UDT; Deploying the UDT Using T-SQL; XML Data Type; When Should You Use XML Instead of Relational Representation?; XML Serialized Objects in a Database; Using XML with Open Schema; XML Data Type as a Parameter of a Stored Procedure; XQuery Modification Statements; Conclusion; 2. Temporary Tables and Table Variables
  • Scope and VisibilityTransaction Context; Statistics; Temporary Table Name Resolution; Schema Changes to Temporary Tables in Dynamic Batches; Global Temporary Tables; Table Variables; tempdb; Scope and Visibility; Transaction Context; Statistics; tempdb Considerations; Table Expressions; Comparison Summary; Summary Exercise-Relational Division; Conclusion; 3. Cursors; Cursor Overhead; Dealing with Each Row Individually; Order-Based Access; Running Aggregations; Maximum Concurrent Sessions; Matching Problems; Conclusion; 4. Dynamic SQL; EXEC Has No Interface; Concatenating Variables; EXEC AT
  • sp_executesqlStatement Limit; Environmental Settings; Uses of Dynamic SQL; Storing Computations; Dynamic Filters; Dynamic PIVOT/UNPIVOT; SQL Injection; SQL Injection: Code Constructed Dynamically at Server; Protecting Against SQL Injection; Conclusion; 5. Views; ORDER BY in a View; Refreshing Views; Modular Approach; Updating Views; View Options; SCHEMABINDING; CHECK OPTION; VIEW_METADATA; Indexed Views; Conclusion; 6. User-Defined Functions; Scalar UDFs; Performance Issues; UDFs Used in Constraints; CHECK Constraints; PRIMARY KEY and UNIQUE Constraints; CLR Scalar UDFs; Regular Expressions
  • Explicit vs. Implicit ConversionsSQL Signature; CLR SQL Signature UDF; Compare Performance of T-SQL and CLR SQL Signature UDFs; Table-Valued UDFs; Split Array; CLR Split UDF; Compare Performance of T-SQL and CLR Split; Multistatement Table-Valued UDFs; Per-Row UDFs; Conclusion; 7. Stored Procedures; Special Stored Procedures; System Stored Procedures; Other Types of Stored Procedures; The Stored Procedure Interface; Output Parameters; Resolution; Compilations, Recompilations, and Reuse of Execution Plans; Recompilations; Parameter Sniffing Problem; EXECUTE AS; Parameterizing Sort Order
  • Dynamic Pivot