Building Applications for SQL Server 2008


Published on

This deck provides an overview of the new developer features in SQL Server 2008.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Building Applications for SQL Server 2008

    1. 1. Dave Bost Developer Evangelist
    2. 2. <ul><li>SQL Server Spatial support </li></ul><ul><li>T-SQL Enhancements </li></ul><ul><li>Visual Studio integration </li></ul><ul><li>SQL CLR </li></ul><ul><li>Reporting Services </li></ul>
    3. 3. <ul><li>SQL Server database development </li></ul><ul><li>.NET Framework application development </li></ul><ul><li>Visual Studio 2008 </li></ul><ul><li>Windows Presentation Foundation </li></ul><ul><li>ASP.NET </li></ul><ul><li>Microsoft Virtual Earth </li></ul><ul><li>OpenGIS </li></ul>
    4. 4. <ul><li>SQL Server 2008 </li></ul><ul><ul><li>New features </li></ul></ul><ul><ul><li>Enhancements </li></ul></ul><ul><ul><li>Programming </li></ul></ul><ul><li>Demos! </li></ul>
    5. 5. <ul><li>Spatial data represents locations </li></ul><ul><ul><li>Which properties overlap? </li></ul></ul><ul><ul><li>Which roads intersect property or each other? </li></ul></ul><ul><ul><li>How many stores/restaurants/houses/car dealerships are located within a geographical area? </li></ul></ul><ul><li>Represented by two primary data types </li></ul><ul><ul><li>Geometry: small areas where curvature of the Earth isn’t so relevant when making calculations </li></ul></ul><ul><ul><ul><li>Flat Earth model </li></ul></ul></ul><ul><ul><ul><li>X, Y coordinates </li></ul></ul></ul><ul><ul><li>Geography: large areas where the curvature of the Earth does matter when making calculations </li></ul></ul><ul><ul><ul><li>Round Earth model </li></ul></ul></ul><ul><ul><ul><li>Latitude and longitude coordinates </li></ul></ul></ul><ul><li>You query for location information as you would any SQL Server data type </li></ul><ul><ul><li>Data types dictated by the OpenGIS standard </li></ul></ul><ul><ul><li>Calculations easy to perform (“black box”) </li></ul></ul>
    6. 6. <ul><li>Geospatial data in SQL Server </li></ul><ul><ul><li>Stored in a proprietary binary format </li></ul></ul><ul><ul><li>Can be input using simple text </li></ul></ul><ul><ul><ul><li>Parse methods exist to convert the text into the internal storage format </li></ul></ul></ul><ul><ul><li>Represents areas using </li></ul></ul><ul><ul><ul><li>Points </li></ul></ul></ul><ul><ul><ul><li>Linestrings </li></ul></ul></ul><ul><ul><ul><li>Polygons </li></ul></ul></ul><ul><ul><ul><li>MultiPoints </li></ul></ul></ul><ul><ul><ul><li>MultiLinestrings </li></ul></ul></ul><ul><ul><ul><li>MultiPolygons </li></ul></ul></ul><ul><ul><ul><li>GeomCollections </li></ul></ul></ul><ul><li>Polygonal areas must be defined in counter-clockwise direction </li></ul><ul><ul><li>Interior areas (“holes”) must be defined in clockwise direction </li></ul></ul><ul><li>Inherently support various calculations and methods </li></ul><ul><ul><li>Spatial Reference ID (SRID) identifies ellipsoid used (flat/round, meters/feet) </li></ul></ul><ul><ul><li>Only instances with like SRID can be directly compared </li></ul></ul>
    7. 7. <ul><li>GEOGRAPHY type has additional requirements </li></ul><ul><ul><li>Coordinate order is longitude/latitude </li></ul></ul><ul><ul><li>A single GEOGRAPHY object cannot span more than a logical hemisphere </li></ul></ul><ul><ul><ul><li>Will throw exceptions if too large </li></ul></ul></ul>
    8. 9. <ul><li>Table Value Parameters </li></ul><ul><li>New Date/Time types </li></ul><ul><li>Time zone awareness </li></ul><ul><li>New MERGE keyword </li></ul><ul><li>New shorthand notation </li></ul>
    9. 10. <ul><li>TVPs are used to insert/update multiple tables at one time </li></ul><ul><ul><li>Multiple tables can be inserted/updated within a single transaction </li></ul></ul><ul><ul><li>MARS-like capability for writing </li></ul></ul><ul><li>ADO.NET updated to include support </li></ul><ul><ul><li>New parameter type: SqlDbType.Structured </li></ul></ul>
    10. 11. <ul><li>Several new types added </li></ul><ul><ul><li>datetime2 </li></ul></ul><ul><ul><li>date </li></ul></ul><ul><ul><li>time </li></ul></ul><ul><ul><li>datetimeoffset </li></ul></ul><ul><li>New functions added </li></ul><ul><ul><li>CONVERT </li></ul></ul><ul><ul><li>SYS* Functions </li></ul></ul><ul><ul><li>DATEDIFF </li></ul></ul>
    11. 12. <ul><li>MERGE allows for insert, update, delete with one keyword </li></ul><ul><ul><li>Merge two tables, source and target </li></ul></ul><ul><ul><li>Target table will be modified based on contents of source table </li></ul></ul><ul><li>Syntax and use can be complex! </li></ul><ul><ul><li>Be sure to review SQL Server Books Online for more details </li></ul></ul>
    12. 13. <ul><li>Allows you to declare a variable and assign a value in one line of code </li></ul><ul><ul><li>More like contemporary programming languages, C# or Visual Basic .NET </li></ul></ul>
    13. 14. <ul><li>Allows you to declare a variable and assign a value in one line of code </li></ul><ul><ul><li>More like contemporary programming languages, C# or Visual Basic .NET </li></ul></ul>
    14. 16. <ul><li>Enhanced project types </li></ul><ul><ul><li>Analysis Services </li></ul></ul><ul><ul><li>Reporting Services </li></ul></ul><ul><li>Entity Framework </li></ul>
    15. 17. <ul><li>Essentially an OR/M tool </li></ul><ul><li>Models relational data using entities </li></ul><ul><ul><li>Can model any relational data source for data access (provider may be required) </li></ul></ul><ul><ul><li>Application-specific domain </li></ul></ul><ul><ul><li>You can work at a higher level of abstraction </li></ul></ul><ul><ul><li>Appropriate amount of information returned </li></ul></ul><ul><ul><li>Lazy-loaded </li></ul></ul><ul><li>What is an entity? </li></ul><ul><ul><li>Structurally like an object </li></ul></ul><ul><ul><ul><li>Has scalars and relationships </li></ul></ul></ul><ul><ul><ul><li>Has identity </li></ul></ul></ul><ul><ul><li>Represent nouns in your application domain </li></ul></ul><ul><li>Not tied specifically to SQL Server </li></ul>
    16. 19. <ul><li>SQL Server has the ability to execute managed code </li></ul><ul><ul><li>Stored procedures </li></ul></ul><ul><ul><li>Functions </li></ul></ul><ul><ul><li>Aggregates </li></ul></ul><ul><ul><li>Table value functions </li></ul></ul><ul><ul><li>User-defined types </li></ul></ul><ul><ul><li>Triggers </li></ul></ul><ul><li>Visual Studio can manage both creation and deployment </li></ul><ul><li>SQL CLR is “off by default” for security reasons </li></ul><ul><ul><li>Must activate per database to enable </li></ul></ul><ul><li>Can be remotely debugged </li></ul><ul><li>With great power comes great responsibility </li></ul><ul><ul><li>Your code executes in the SQL Server processing stream </li></ul></ul>
    17. 20. <ul><li>Visual Studio provides templates for the various SQL CLR constructs </li></ul><ul><ul><li>Uses Database project type </li></ul></ul><ul><ul><li>Simply “add new” like any other item you might add </li></ul></ul><ul><li>Metadata controls SQL Server behavior </li></ul><ul><ul><li>Attributes control programmatical type </li></ul></ul><ul><ul><ul><li>Microsoft.SqlServer.Server.SqlProcedure </li></ul></ul></ul><ul><ul><ul><li>Microsoft.SqlServer.Server.SqlFunction </li></ul></ul></ul><ul><ul><ul><li>Microsoft.SqlServer.Server.SqlUserDefinedAggregate </li></ul></ul></ul><ul><ul><ul><li>Microsoft.SqlServer.Server.SqlTrigger </li></ul></ul></ul><ul><ul><ul><li>Microsoft.SqlServer.Server.SqlUserDefinedType </li></ul></ul></ul><ul><li>You write your logic using a .NET-supported language </li></ul><ul><li>You work with other objects in the Microsoft.SqlServer.Server namespace to retrieve and return data </li></ul><ul><li>Very ADO.NET-like, but not ADO.NET </li></ul><ul><li>Can be assigned security levels </li></ul><ul><ul><li>Safe, External, Unsafe </li></ul></ul>
    18. 22. <ul><li>SQL Server standard for reporting </li></ul><ul><ul><li>Managed enterprise reporting </li></ul></ul><ul><ul><li>Ad-hoc reporting </li></ul></ul><ul><ul><li>Embedded reporting </li></ul></ul><ul><ul><li>Web-based reporting </li></ul></ul><ul><li>Reports can be formatted in a variety of ways </li></ul><ul><ul><li>PDF </li></ul></ul><ul><ul><li>Word 2007 </li></ul></ul><ul><ul><li>HTML </li></ul></ul><ul><li>Reports are exposed via a Web Service </li></ul><ul><ul><li>Can be integrated with SharePoint </li></ul></ul><ul><ul><li>Dependency on IIS removed (uses http.sys) </li></ul></ul><ul><li>Strong designer and wizard support in Visual Studio </li></ul><ul><li>Enhanced configuration and administration tool </li></ul>
    19. 23. <ul><li>Design reports in Visual Studio 2008 SP1 </li></ul><ul><ul><li>Query for data </li></ul></ul><ul><ul><li>Assign query results to report </li></ul></ul><ul><ul><li>Design report style </li></ul></ul><ul><ul><ul><li>Colors </li></ul></ul></ul><ul><ul><ul><li>Fonts </li></ul></ul></ul><ul><ul><li>Deploy report </li></ul></ul><ul><ul><ul><li>Web Service </li></ul></ul></ul><ul><ul><ul><li>SharePoint Services </li></ul></ul></ul><ul><li>Wizard available for initial report design </li></ul>
    20. 25. <ul><li>Visit MSDN at </li></ul><ul><li>Visit the url below for additional information </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>
    21. 26. Are you ready to take your career as a developer to the next level? Looking for a learning experience that is designed for you? Join MSDN Ramp Up and Summit Your Career! MSDN Ramp Up is your online source that provides free training and technical resources to help take your development skills to the next level. <ul><li>Step-by-Step training plans to build your development skills. </li></ul><ul><li>Premium technical content created by expert developers for developers. </li></ul><ul><li>Access to valuable online e-learning, e-references, and virtual labs. </li></ul><ul><li>50% discount on select certification exams and 30% discount on Microsoft Press training kits. </li></ul><ul><li>Join Ramp Up for free today! </li></ul><ul><li>Go to: </li></ul>
    22. 27. “ Looking at someone’s code, but with audio”
    23. 28. <ul><li>The nature of software development is radically changing ... </li></ul><ul><li>ARE YOU READY? </li></ul><ul><li>Prepare yourself for a demanding future. Attend the MSDN Developer Conference. </li></ul><ul><ul><ul><ul><li>Experience Microsoft’s Cloud Computing Platform </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Be among the first to see Windows 7 </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Take your .NET skills to the next level </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The Cost? Just $99 </li></ul></ul></ul></ul><ul><li>To register, check out </li></ul><ul><li>RSVP Code: MDCDEV </li></ul><ul><li>Houston 12/9/08 Orlando 12/11/08 Atlanta 12/16/08 Chicago 1/13/09 Minneapolis 1/13/09 Washington, DC 1/16/09 New York 1/20/09 Boston 1/22/09 Detroit 1/22/09 Dallas 1/26/09 San Francisco 2/19/09 </li></ul><ul><li>ONILNE: Find our tag under #MSDNDevCon at Facebook, Twitter, Flickr, Delicious and Twemes </li></ul>
    24. 29. Dave Bost thank you!
    25. 30. “ Looking at someone’s code, but with audio”
    26. 31. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.