View
214
Download
0
Embed Size (px)
Citation preview
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR IntegrationADO.NET 2.0ADO.NET 2.0
Mike Taulty Mike Taulty
[email protected]@microsoft.com
http://mtaulty.comhttp://mtaulty.com
AgendaAgenda
select top 1 * select top 1 *
fromfrom
[sql2005 developer features][sql2005 developer features]
gogo
waitfor delay ’00:45:00’waitfor delay ’00:45:00’
select *select *
fromfrom
[ado v2 features];[ado v2 features];
gogo
SQL Server Development TodaySQL Server Development Today
SQL Server SQL Server
RelationalRelationalEngineEngine
StorageStorageEngineEngine SchedulerScheduler
User CodeUser Code(Procedures, Functions, Triggers)(Procedures, Functions, Triggers)
T-SQLT-SQL
…Purpose?
Libraries?
Tools?
Skills?
??Extended sp?Extended sp?COM objects?COM objects?
System
System.Data System.Xml
System.Web
Globalization
Diagnostics
Configuration
Collections
Resources
Reflection
Net
IO
Threading
Text
ServiceProcess
Security
Design
OleDb
SqlTypes
SqlClient
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Design ComponentModelCommon Language Runtime
Class Loader
IL to NativeCompilers
CodeManager
GarbageCollector
Security Engine Debug Engine
Type Checker Exception Manager
Thread Support COM Marshaler
Base Class Library Support
.NET Assembly
Metadata
Code (CIL)
The .NET Development PlatformThe .NET Development Platform
SQL Server 2005 DevelopmentSQL Server 2005 Development
SQL Server 2005 SQL Server 2005
RelationalRelationalEngineEngine
StorageStorageEngineEngine SchedulerScheduler
User CodeUser Code(Procedures, Functions, Triggers)(Procedures, Functions, Triggers)
T-SQLT-SQL
…
System
System.Data System.Xml
System.Web
Globalization
Diagnostics
Configuration
Collections
Resources
Reflection
Net
IO
Threading
Text
ServiceProcess
Security
Design
OleDb
SqlTypes
SqlClient
XPath
XSLT
Runtime
InteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
Services
Description
Discovery
Protocols
UI
HtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Design ComponentModel
Common Language Runtime
Class Loader
IL to NativeCompilers
CodeManager
GarbageCollector
Security Engine Debug Engine
Type Checker Exception Manager
Thread Support COM Marshaler
Base Class Library Support
.NET Assembly
Metadata
Code (CIL)
SQL Server 2005 DevelopmentSQL Server 2005 Development
SQL Server 2005 SQL Server 2005
RelationalRelationalEngineEngine
StorageStorageEngineEngine SchedulerScheduler
User CodeUser Code(Procedures, Functions, Triggers)(Procedures, Functions, Triggers)
T-SQLT-SQL
…
System
System.Data System.Xml
System.Web
Globalization
Diagnostics
Configuration
Collections
Resources
Reflection
Net
IO
Threading
Text
ServiceProcess
Security
Design
OleDb
SqlTypes
SqlClient
XPath
XSLT
Runtime
InteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
Services
Description
Discovery
Protocols
UI
HtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Design ComponentModel
Common Language Runtime
Class Loader
IL to NativeCompilers
CodeManager
GarbageCollector
Security Engine Debug Engine
Type Checker Exception Manager
Thread Support COM Marshaler
Base Class Library Support
.NET Assembly
Metadata
Code (CIL)
What can we do with CLR code?What can we do with CLR code?
Common T-SQL objects can be implemented in Common T-SQL objects can be implemented in CLR codeCLR code
User defined functions (and table valued functions)User defined functions (and table valued functions)
Stored proceduresStored procedures
TriggersTriggers
Additional objects can be implemented in CLR Additional objects can be implemented in CLR codecode
User Defined TypesUser Defined Types
User Defined Aggregates (MAX, MIN, SUM … )User Defined Aggregates (MAX, MIN, SUM … )
When do we use CLR code?When do we use CLR code?
T-SQL code is great for CRUD operationsT-SQL code is great for CRUD operations
CLR code is great for;CLR code is great for;
General purposeGeneral purpose
Library support (.NET Framework)Library support (.NET Framework)
Tool support (Visual Studio 2005)Tool support (Visual Studio 2005)
Safety and (by scenario) performanceSafety and (by scenario) performance
““For the dirty jobs T-SQL doesn’t want to do”For the dirty jobs T-SQL doesn’t want to do”
Where do we use CLR code?Where do we use CLR code?
Round trip Round trip
““Distance” between the code and the dataDistance” between the code and the data
Scale up/out possibilities of different tiersScale up/out possibilities of different tiers
Abstraction of the database technologyAbstraction of the database technology
Security requirementsSecurity requirements
Set-based versus procedural codeSet-based versus procedural code
Possibilities for using shared code libraries in multiple tiersPossibilities for using shared code libraries in multiple tiers
AgendaAgenda
select top 1 * select top 1 *
fromfrom
[sql2005 developer features][sql2005 developer features]
gogo
waitfor delay ’00:45:00’waitfor delay ’00:45:00’
select *select *
fromfrom
[ado v2 features];[ado v2 features];
gogo
ADO.NET 2.0 FeaturesADO.NET 2.0 Features
SQL 2005 User Defined Type supportSQL 2005 User Defined Type support
Query notificationsQuery notifications
Asynchronous supportAsynchronous support
Multiple active result setsMultiple active result sets
Client statisticsClient statistics
Factory APIsFactory APIs
DataSet & DataTable enhancementsDataSet & DataTable enhancements
Binary serialization, stand-alone DataTablesBinary serialization, stand-alone DataTables
Bulk Load APIBulk Load API
SQL Server 2005 ResourcesSQL Server 2005 Resources
Web SitesWeb SitesProduct site Product site http://www.microsoft.com/sql/2005/default.asphttp://www.microsoft.com/sql/2005/default.asp
MSDN Centre MSDN Centre http://http://msdn.microsoft.com/sqlmsdn.microsoft.com/sql
SQL Team SQL Team http://http://www.sqlteam.comwww.sqlteam.com
SQL Junkies SQL Junkies http://http://www.sqljunkies.comwww.sqljunkies.com
SQL Server 2005 Express EditionSQL Server 2005 Express Editionhttp://http://lab.msdn.microsoft.com/express/sql/default.aspxlab.msdn.microsoft.com/express/sql/default.aspx
WebcastsWebcastshttp://msdn.microsoft.com/sql/2005webcasts http://msdn.microsoft.com/sql/2005webcasts
BooksBookshttp://www.microsoft.com/sql/2005/samplechapters.asp http://www.microsoft.com/sql/2005/samplechapters.asp
User GroupsUser Groupshttp://msdn.microsoft.com/usergroups/find.asp http://msdn.microsoft.com/usergroups/find.asp
NewsgroupsNewsgroupsMicrosoft.public.sqlserver.*Microsoft.public.sqlserver.*
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR IntegrationADO.NET 2.0ADO.NET 2.0
Mike Taulty Mike Taulty
[email protected]@microsoft.com
http://mtaulty.com http://mtaulty.com
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.