0
Building Applications with SQL Server 2008 Lynn Langit http://blogs.msdn.com/SoCalDevGal
What Will We cover? <ul><li>SQL Server Spatial support </li></ul><ul><li>T-SQL Enhancements </li></ul><ul><li>Visual Studi...
What is Spatial Data? <ul><li>Spatial data represents locations </li></ul><ul><ul><li>Which roads intersect property or ea...
Representing Spatial Data <ul><li>Stored in proprietary binary format </li></ul><ul><ul><li>Can be input using simple text...
Geographical Data <ul><li>GEOGRAPHY type has additional requirements </li></ul><ul><ul><li>Coordinate order is longitude/l...
SQL Server Geospatial and Virtual Earth
Geo Spatial Links <ul><li>Practical uses for Geospatial data  </li></ul><ul><li>Series on use of Geospatial data in SQL Se...
Enhancements to T-SQL <ul><li>Table Value Parameters </li></ul><ul><li>New Date/Time types </li></ul><ul><li>Time zone awa...
Table Value Parameters <ul><li>TVPs are used to insert/update multiple tables at one time </li></ul><ul><ul><li>MARS-like ...
Dates and Time <ul><li>Several new types added </li></ul><ul><ul><li>datetime2 </li></ul></ul><ul><ul><li>date </li></ul><...
MERGE <ul><li>MERGE allows for insert, update, delete with one keyword </li></ul><ul><ul><li>Merge two tables,  source  an...
Shorthand Notation <ul><li>Allows you to declare a variable and assign a value in one line of code </li></ul><ul><ul><li>M...
T-SQL Enhancements
Visual Studio Integration <ul><li>Enhanced project types </li></ul><ul><ul><li>SQL CLR Database projects </li></ul></ul><u...
Entity Framework <ul><li>Essentially an OR/M tool </li></ul><ul><li>Models relational data using entities </li></ul><ul><u...
Architecture
Visual Studio Integration
SQL CLR <ul><li>SQL Server has the ability to execute managed code </li></ul><ul><ul><li>Stored procedures </li></ul></ul>...
Programming SQL CLR <ul><li>Visual Studio provides templates for the various SQL CLR constructs </li></ul><ul><ul><li>Uses...
SQL CLR
Reporting Services <ul><li>SQL Server standard for reporting </li></ul><ul><ul><li>Managed enterprise reporting / Ad-hoc r...
Programming Reports <ul><li>Design reports in Visual Studio 2008 SP1 </li></ul><ul><ul><li>Query for data </li></ul></ul><...
Reporting Services
For More Information <ul><li>blogs.msdn.com/SoCalDevGal </li></ul><ul><li>www.microsoft.com/sql </li></ul>Pre-order it now
Surprise! <ul><li>Only for attendees of TechDays! </li></ul>
Upcoming SlideShare
Loading in...5
×

SQL Server 2008 for Developers

2,891

Published on

Slides from my talk on SQL Server 2008 for developers at OC Tech Days November 2008

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,891
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
290
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • Hello and Welcome to this MSDN session on “Building Applications with SQL Server2008
  • Transcript of "SQL Server 2008 for Developers"

    1. 1. Building Applications with SQL Server 2008 Lynn Langit http://blogs.msdn.com/SoCalDevGal
    2. 2. What Will We cover? <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. What is Spatial Data? <ul><li>Spatial data represents locations </li></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 </li></ul></ul><ul><ul><ul><li>Flat Earth model or X, Y coordinates </li></ul></ul></ul><ul><ul><li>Geography : large areas where the curvature of the Earth does matter </li></ul></ul><ul><ul><ul><li>Round Earth model or 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>
    4. 4. Representing Spatial Data <ul><li>Stored in proprietary binary format </li></ul><ul><ul><li>Can be input using simple text ( Parse methods convert text into internal storage format) </li></ul></ul><ul><ul><li>Represents areas using </li></ul></ul><ul><ul><ul><li>Points, Line strings, Polygons </li></ul></ul></ul><ul><ul><ul><li>Multi Points, Multi Line strings, Multi Polygons </li></ul></ul></ul><ul><ul><ul><li>Geom Collection </li></ul></ul></ul><ul><li>Areas must be defined in counter-clockwise direction, but Interior areas (“holes”) must be defined in clockwise direction </li></ul><ul><li>Spatial Reference ID (SRID) identifies ellipsoid used (flat/round, meters/feet) </li></ul><ul><ul><li>Only instances with like SRID can be directly compared </li></ul></ul>
    5. 5. Geographical Data <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>
    6. 6. SQL Server Geospatial and Virtual Earth
    7. 7. Geo Spatial Links <ul><li>Practical uses for Geospatial data </li></ul><ul><li>Series on use of Geospatial data in SQL Server 2008 </li></ul><ul><li>OpenGIS standards </li></ul><ul><li>OGC Methods on Geography Instances </li></ul><ul><li>OGC Methods on Geometry Instances </li></ul>
    8. 8. Enhancements to T-SQL <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. 9. Table Value Parameters <ul><li>TVPs are used to insert/update multiple tables at one time </li></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><ul><ul><li>MSDN documentation </li></ul></ul>
    10. 10. Dates and Time <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. 11. MERGE <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>Review BOL for details </li></ul></ul>
    12. 12. Shorthand Notation <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. 13. T-SQL Enhancements
    14. 14. Visual Studio Integration <ul><li>Enhanced project types </li></ul><ul><ul><li>SQL CLR Database projects </li></ul></ul><ul><ul><li>Analysis Services </li></ul></ul><ul><ul><ul><li>OLAP cubes </li></ul></ul></ul><ul><ul><ul><li>Data Mining Structures </li></ul></ul></ul><ul><ul><li>Integration Services </li></ul></ul><ul><ul><li>Reporting Services </li></ul></ul>
    15. 15. Entity Framework <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. 16. Architecture
    17. 17. Visual Studio Integration
    18. 18. SQL CLR <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>
    19. 19. Programming SQL CLR <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>
    20. 20. SQL CLR
    21. 21. Reporting Services <ul><li>SQL Server standard for reporting </li></ul><ul><ul><li>Managed enterprise reporting / Ad-hoc reporting / Embedded reporting / Web-based reporting </li></ul></ul><ul><li>Reports can be formatted in a variety of ways </li></ul><ul><ul><li>PDF / Word 2007 / HTML, custom </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><ul><li>Can also use Report Builder </li></ul></ul><ul><li>Enhanced configuration and administration tool </li></ul><ul><li>SSRS available in SQL Server Express 2008 w/Adv Services </li></ul>
    22. 22. Programming Reports <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><ul><ul><li>Report Viewer control in Visual Studio </li></ul></ul></ul><ul><li>Wizard available for initial report design </li></ul>
    23. 23. Reporting Services
    24. 24. For More Information <ul><li>blogs.msdn.com/SoCalDevGal </li></ul><ul><li>www.microsoft.com/sql </li></ul>Pre-order it now
    25. 25. Surprise! <ul><li>Only for attendees of TechDays! </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×