SQL Server 2005:.NET Framework Programming in the Database Tim Sneath Architectural Engineer, Microsoft

Slides:



Advertisements
Similar presentations
Ofir Aspis 1/2010 VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo Editor features Extending.
Advertisements

Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
SQL Server 2005: Analysis Services and DTS Tim Sneath Architectural Engineer, Microsoft
SQL Server 2005 CLR Integration ADO.NET 2.0 Mike Taulty
Design & Development Tools: Visual Studio 2005 SQL Server 2005 Biztalk Server 2006 David Gristwood, Mike Taulty Developer & Platform Group Microsoft Ltd.
1 Overview of what’s new for developers in SQL Server “Yukon” James Hamilton General Manager Microsoft Corporation James Hamilton General Manager Microsoft.
If you have SQL Server 2005, you get all the features below plus the following: If you have SQL Server 2000, you get all the features below plus.
What’s new for Rich Clients? Martin Parry Developer & Platform Group Microsoft Ltd
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Passage Three Introduction to Microsoft SQL Server 2000.
SQL Server ® 2008 ® Native Client. Agenda  Introduction to SQL Server Native Client  Building High-Performance Data Access Solutions  Going Beyond.
SQL Server 2005 Integration Services Mike Taulty Developer & Platform Group Microsoft Ltd
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
Overview of SQL Server Alka Arora.
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
Introduction to .Net Framework
Programming the CLR in SQL Server 2005 Mark Blomsma Develop-One Session Code: DB.08.
Multi-Language Extensibility in MS SQL Server James Hamilton Microsoft SQL Server
An Introduction To CLR Integration in SQL Server 2005 (Yukon) Dr Greg Low.
SQL Server 2005 The Common Language Runtime (CLR) Integration Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Web Development.
Session 1 - Introduction and Data Access Layer
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
.NET Database Programmability and Extensibility in Microsoft SQL Server José A. Blakeley, Mat Henaire, Christian Kleinerman, Isaac Kunen, Adam Prout, Vineet.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
Module 9 Designing and Implementing Stored Procedures.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
Visual Studio 2008 and.NET 3.5 provide seamless support for all of the protocols and techniques popular in Web 2.0-style applications. Visual Studio.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
James Akrigg Microsoft Ltd Integrating InfoPath Forms Into Workflow Solutions And Business Processes.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
EBZ319 Building Enterprise Web Sites Using MCMS 2002 Daniel Kogan Program Manager CMS Group Microsoft Corporation Pat Miller Developer CMS Group Microsoft.
Windows Role-Based Access Control Longhorn Update
Data Types Lesson 4. Skills Matrix Table A table stores your data. Tables are relational in that they are organized as rows and columns (a matrix). Each.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
Language Integrated Query (LINQ). Data Access Programming Challenges Developers must learn data store-specific query syntax Multiple, disparate data stores.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Tips & Tricks: Writing Performant Managed Code Rico Mariani FUNL04 Performance Architect Microsoft Corporation.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
Visit our Focus Rooms Evaluation of Implementation Proposals by Dynamics AX R&D Solution Architecture & Industry Experts Gain further insights on Dynamics.
Best Practices for SQL Server 2005 Nauzad Kapadia [MVP] Quartz Systems
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
In this session, you will learn to: Understand managed code Create managed database objects Define the Hypertext Transfer Protocol endpoints Implement.
Joy Rathnayake Senior Architect – Virtusa Pvt. Ltd.
Building Enterprise Applications Using Visual Studio®
Introducing the Microsoft® .NET Framework
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Visual Studio Tools for Office 2005
SQL Server Data Tools for Visual Studio Part I: Core SQL Server Tools
Language Integrated Query (LINQ)
DAT381 Team Development with SQL Server 2005
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Module 10: Implementing Managed Code in the Database
Microsoft Build /27/2019 2:26 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Developing for Windows Azure
Mark Quirk Head of Technology Developer & Platform Group
Getting Data Where and When You Want it with SQL Server 2005
9/8/ :03 PM © 2006 Microsoft Corporation. All rights reserved.
Presentation transcript:

SQL Server 2005:.NET Framework Programming in the Database Tim Sneath Architectural Engineer, Microsoft

.NET Framework Integration Benefits  Enhanced programming model Full access to the BCL from SQL Server  Safety and security Integration of SQL “native” and CLR security  User-defined types and aggregates  Common development environment Shared tools from client-tier to data-tier Authoring, debugging, deployment, and profiling  Performance and scalability For processor-centric tasks

T-SQL Versus C# For Logic Converting Binary To Hex is null return null nvarchar(4000) = = 1 = '0x' begin 1) & 0xF & 0xF0 > 0 / 0xF + ((case < 10 then = 10 then 'A' = 11 then 'B' = 12 then 'C' = 13 then 'D' = 14 then 'E' = 15 then 'F' else 'Z' end)+(case < 10 then = 10 then 'A' = 11 then 'B' = 12 then 'C' = 13 then 'D' = 14 then 'E' = 15 then 'F' else 'Z' end))end if (value == null) return null; StringBuilder sb = new StringBuilder(); foreach (byte b in value) sb.Append(b.ToString("X2")); return sb.ToString();

Design Guidelines Choosing Between Managed Code and T-SQL T-SQL is best suited for data access Familiar, simple programming model Static compilation model Optimised for data access Managed code is ideal for procedural programming and computation IL compiled to x86/ia64 (native) code at runtime, easily outperforms interpreted T-SQL Computationally-intensive business logic encapsulated as functions

Runtime hosted in-proc by SQL Server 2005 SQL Queries: SELECT Payment (Total, Interest) FROM Credit WHERE CustomerID = '048349' The Developer Experience SQL Server VS.NET Project VB / C# / C++ Assembly: “CredLib.dll” SQL Data Definition: CREATE ASSEMBLY then: CREATE FUNCTION CREATE PROCEDURE CREATE TRIGGER CREATE TYPE

demo Stored Procedures

Some Questions Where does a catalogued assembly go? How do you view what assemblies are catalogued? How do you amend or delete an assembly? How do dependent assemblies get managed? How do you share assemblies across databases? When does the CLR get loaded in process? How do you debug a SQL Server assembly?

Development Environment New SQL Server Project template in VS 2005 for SQL Server 2005 managed code Server debug integration Full debugger visibility Set breakpoints anywhere Single step support Single step support Between languages Between deployment tiers Auto-deploymentAttributes

demo Scalar-Valued Functions

Interacting with the Engine

demo Triggers Table-Valued Functions

CLR Security: Permission Sets SAFE Execute & data access permission No access to resources outside SQL Server No unmanaged calls Must be verifiable EXTERNAL_ACCESS Adds ability to access external resources via managed APIs SQL Server impersonates the caller for external access Must be verifiable Requires new EXTERNAL ACCESS permission to create UNSAFE Can call unmanaged code Need not be unverifiable Only system administrator can create

CLR Security: Restrictions Protection Mechanisms Fusion Loader Hook [HostProtection] attribute Most of System.* available, including: mscorlib.dllsystem.data.dllsystem.dllsystem.xml.dllsystem.security.dllsystem.web.services.dllmicrosoft.visualbasic.dll Non-applicable functionality eliminated: System.Windows.FormsSystem.Drawing System.Web, …

User Defined Types / Aggregations Types Complex structure and associated behaviour Implemented as managed classes with a specific contract Deep engine support Query processing, Distributed Queries, Replication, BCP, etc. Aggregates Extensibility hook to aggregate values over a group during query processing Contract details Initialise a group Accumulate a value Merge groups Finish computation and return result

demo User-Defined Types (UDTs)

Tips for Developers and DBAs Use SqlPipe.Execute instead of cmd.ExecuteReader() Use SqlDataReader instead of T-SQL cursors Use SqlExecutionContext instead of SqlCommand Catalogue debugger symbols and source code Use db_option 'clr enabled' 1/0 to control CLR loading Performance views: sys.dm_exec_resultssys.dm_clr_loaded_assembliessys.dm_exec_query_stats Use DBCC STACKDUMP to generate a stack dump

Resources Articles (based on Beta 1) ca9beb118fde/SQL_Server_Yukon_New_Features_CLR.pdf Blogshttp://blogs.msdn.com/timshttp:// Books Online – Architectural Topics MSDN Library – Class Syntax Traininghttp://

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.