SlideShare una empresa de Scribd logo
1 de 20
Where .NET meets SQL Server… SQL CLRJurgen Asselman.NET and SQL Server Consultantjurgen.asselman@ordina.be,[object Object]
About me…,[object Object],Jurgen Asselman,[object Object],14 years of experience in IT,[object Object],@Ordina since 2007,[object Object],Before Ordina +7 years @Sony ,[object Object],.NET and SQL Server Consultant @Elia,[object Object],MCIT PRO SQL Server 2008,[object Object],2,[object Object]
Agenda,[object Object],About SQL CLR,[object Object],Benefits,[object Object],What can it be used for?,[object Object],The permissions overview,[object Object],Installation of a CLR assembly,[object Object],The configuration issue…,[object Object],Tips & tricks,[object Object],When to use SQL CLR,[object Object],Conclusion,[object Object],3,[object Object]
About SQL CLR,[object Object],Hosting Microsoft .NET Framework in SQL Server Engine,[object Object],Run managed code in your database,[object Object],Alternative for,[object Object],Extended Stored Procedures,[object Object],COM Automation,[object Object],Complex T-SQL algoritms,[object Object],xp_cmdshell,[object Object],Does NOT replace T-SQL nor DBAs,[object Object],4,[object Object],SQL Engine,[object Object],CLR,[object Object],Hosting,[object Object],Layer,[object Object],SQL OS Layer,[object Object],Windows OS,[object Object]
Benefits,[object Object],Larger programmer productivity,[object Object],Enhanced programming model,[object Object],Enhanced safety and security,[object Object],Common development environment,[object Object],Performance and scalability,[object Object],5,[object Object]
What can it be used for?,[object Object],Stored Procedures (SP),[object Object],Triggers,[object Object],User-Defined Functions (UDF),[object Object],User Defined Aggregates (UDA),[object Object],User Defined Types (UDT),[object Object],6,[object Object]
Demo time,[object Object],Create a User Defined Function, ,[object Object],a Stored Procedure ,[object Object],and a User Defined Type,[object Object],7,[object Object]
The permissions overview,[object Object],SAFE,[object Object],Allows data access, basic libraries,[object Object],EXTERNAL_ACCESS,[object Object],Allows access to IO libraries,[object Object],UNSAFE,[object Object],Allows access to unmanaged code,[object Object],8,[object Object]
Installation of a CLR assembly,[object Object],By default SQL CLR is turned off  turn it on,[object Object],Via ,[object Object],T-SQL ,[object Object],SSMS,[object Object],Install your assemblies via,[object Object],T-SQL,[object Object],SSMS,[object Object],9,[object Object]
Demo time,[object Object],Enable SQL CLR,[object Object],Install our created assembly,[object Object],10,[object Object]
The configuration issue…,[object Object],The .config file as we know it in .NET development,[object Object],in sqlserver.exe.config!,[object Object],change configuration items  restart your SQL Server,[object Object],Best practiceconfiguration table in which keys and values are stored,[object Object],11,[object Object]
Tips & tricks	,[object Object],Enable SQL CLR on your database server,[object Object],EXECsp_configure‘clr enabled’, 1,[object Object],RECONFIGURE,[object Object],   GO,[object Object],12,[object Object]
Tips & tricks	,[object Object],When you create your CLR UDF or Stored Procedure the T-SQL way, take a look at this syntax,[object Object],CREATE[ FUNCTION / STORED PROCEDURE / TRIGGER … ]({parameters}),[object Object],[RETURNS {return value}],[object Object],AS,[object Object],     EXTERNAL NAME [Assembly].[Namespace].[Function],[object Object],13,[object Object]
Tips & tricks	,[object Object],Using a connection string in the stored procedure, when connecting to the current database,[object Object],using(SqlConnection connection = newSqlConnection("context connection=true")),[object Object],        {,[object Object],//your code here,[object Object],        },[object Object],14,[object Object]
When to use SQL CLR,[object Object],Do I need to manipulate data before it is displayed?,[object Object],.NET code and SQL CLR,[object Object],Do I need to do set-based operations?,[object Object],T-SQL,[object Object],Do I need to do extensive calculations or custom algorithms?,[object Object],.NET code and SQL CLR,[object Object],Are my developers SQL gurus but .NET newbies,[object Object],T-SQL,[object Object],Do I have loads of stored procedures that are hard to manage?,[object Object],.NET code and SQL CLR,[object Object],15,[object Object]
Demo time,[object Object],Use our created and installed assembly ,[object Object],in SQL Server,[object Object],16,[object Object]
Conclusion,[object Object],SQL CLR is a powerful feature,[object Object],Advantages,[object Object],Use .NET base-class-library,[object Object],Implement Complex Code,[object Object],Interface with external resources,[object Object],Caution,[object Object],Doesn’t replace T-SQL,[object Object],17,[object Object]
Questions?,[object Object],18,[object Object]
Want to know more? ,[object Object],Contact Jurgen Asselman,[object Object],Email:  jurgen.asselman@ordina.be,[object Object],Blog: http://jurgenasselman.blogspot.com,[object Object],Twitter: @jurgenasselman,[object Object],19,[object Object]
Follow Ordina…,[object Object],20,[object Object],Share your thoughts via #SOFTC ,[object Object],Follow us on twitter: @OrdinaBE,[object Object],Find the presentationsonwww.slideshare.net/ordinaBe,[object Object],Be informed atwww.linkedin.com/company/ordina-belgium,[object Object]

Más contenido relacionado

La actualidad más candente

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
CLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsCLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsKarolis Labrencis
 
Deploying nginx with minimal system resources
Deploying nginx with minimal system resourcesDeploying nginx with minimal system resources
Deploying nginx with minimal system resourcesMax Ukhanov
 
Ansible-for-openstack
Ansible-for-openstackAnsible-for-openstack
Ansible-for-openstackUdayendu Kar
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentChristian Schwede
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
 
VMware compute driver for OpenStack
VMware compute driver for OpenStackVMware compute driver for OpenStack
VMware compute driver for OpenStackopenstackindia
 
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...Puppet
 
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)webhostingguy
 
CloudOps CloudStack Days, Austin April 2015
CloudOps CloudStack Days, Austin April 2015CloudOps CloudStack Days, Austin April 2015
CloudOps CloudStack Days, Austin April 2015CloudOps2005
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)Ashish Gupta
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deploymentNicholas McClay
 
HKG15-204: OpenStack: 3rd party testing and performance benchmarking
HKG15-204: OpenStack: 3rd party testing and performance benchmarkingHKG15-204: OpenStack: 3rd party testing and performance benchmarking
HKG15-204: OpenStack: 3rd party testing and performance benchmarkingLinaro
 
Java App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDJava App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDSeun Matt
 

La actualidad más candente (20)

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
CLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsCLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.js
 
Deploying nginx with minimal system resources
Deploying nginx with minimal system resourcesDeploying nginx with minimal system resources
Deploying nginx with minimal system resources
 
Ansible-for-openstack
Ansible-for-openstackAnsible-for-openstack
Ansible-for-openstack
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deployment
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
 
VMware compute driver for OpenStack
VMware compute driver for OpenStackVMware compute driver for OpenStack
VMware compute driver for OpenStack
 
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
 
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)
SDC - Programming the CLR in SQL Server 2005.ppt (1.51 MB)
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
 
Oracle WebLogic
Oracle WebLogicOracle WebLogic
Oracle WebLogic
 
Ansible testing
Ansible   testingAnsible   testing
Ansible testing
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
CloudOps CloudStack Days, Austin April 2015
CloudOps CloudStack Days, Austin April 2015CloudOps CloudStack Days, Austin April 2015
CloudOps CloudStack Days, Austin April 2015
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
HKG15-204: OpenStack: 3rd party testing and performance benchmarking
HKG15-204: OpenStack: 3rd party testing and performance benchmarkingHKG15-204: OpenStack: 3rd party testing and performance benchmarking
HKG15-204: OpenStack: 3rd party testing and performance benchmarking
 
Java App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CDJava App On Digital Ocean: Deploying With Gitlab CI/CD
Java App On Digital Ocean: Deploying With Gitlab CI/CD
 

Similar a Ordina SOFTC Presentation - SQL CLR

Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Netwebhostingguy
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integrationPeter Gfader
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMayank Prasad
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developerswebhostingguy
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hydewebhostingguy
 
SQL Server 2005 CLR Integration
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR Integration
SQL Server 2005 CLR Integrationwebhostingguy
 
Performance tuning a quick intoduction
Performance tuning   a quick intoductionPerformance tuning   a quick intoduction
Performance tuning a quick intoductionRiyaj Shamsudeen
 
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara Universityantimo musone
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 EditionMark Broadbent
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorialKlausePaulino
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersIke Ellis
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMayank Prasad
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaMySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaSveta Smirnova
 

Similar a Ordina SOFTC Presentation - SQL CLR (20)

Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Net
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
 
SQL Server 2005 CLR Integration
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR Integration
SQL Server 2005 CLR Integration
 
Performance tuning a quick intoduction
Performance tuning   a quick intoductionPerformance tuning   a quick intoduction
Performance tuning a quick intoduction
 
Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara University
 
10053 otw
10053 otw10053 otw
10053 otw
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial
 
Store procedures
Store proceduresStore procedures
Store procedures
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developers
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 
MySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance SchemaMySQL Troubleshooting with the Performance Schema
MySQL Troubleshooting with the Performance Schema
 

Más de Ordina Belgium

Ordina SOFTC Presentation - UsingGeoData_ReportBuilder
Ordina SOFTC Presentation - UsingGeoData_ReportBuilderOrdina SOFTC Presentation - UsingGeoData_ReportBuilder
Ordina SOFTC Presentation - UsingGeoData_ReportBuilderOrdina Belgium
 
Ordina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deploymentOrdina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deploymentOrdina Belgium
 
Ordina SOFTC Presentation - Developing against SharePoint 2010 Lists
Ordina SOFTC Presentation - Developing against SharePoint 2010 ListsOrdina SOFTC Presentation - Developing against SharePoint 2010 Lists
Ordina SOFTC Presentation - Developing against SharePoint 2010 ListsOrdina Belgium
 
Ordina SOFTC Presentation - SharePoint 2010 Architecture
Ordina SOFTC Presentation - SharePoint 2010 ArchitectureOrdina SOFTC Presentation - SharePoint 2010 Architecture
Ordina SOFTC Presentation - SharePoint 2010 ArchitectureOrdina Belgium
 
Ordina SOFTC Presentation - Office 365
Ordina SOFTC Presentation - Office 365Ordina SOFTC Presentation - Office 365
Ordina SOFTC Presentation - Office 365Ordina Belgium
 
Ordina SOFTC Presentation - Desktop Virtualization
Ordina SOFTC Presentation - Desktop VirtualizationOrdina SOFTC Presentation - Desktop Virtualization
Ordina SOFTC Presentation - Desktop VirtualizationOrdina Belgium
 
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina Belgium
 
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina Belgium
 
Ordina SOFTC Presentation - Bridging the project and work management gap
Ordina SOFTC Presentation - Bridging the project and work management gapOrdina SOFTC Presentation - Bridging the project and work management gap
Ordina SOFTC Presentation - Bridging the project and work management gapOrdina Belgium
 
Ordina SOFTC Presentation - Visual Studio LightSwitch
Ordina SOFTC Presentation - Visual Studio LightSwitchOrdina SOFTC Presentation - Visual Studio LightSwitch
Ordina SOFTC Presentation - Visual Studio LightSwitchOrdina Belgium
 
Ordina SOFTC Presentation - Building a WP7 app - Lessons learned
Ordina SOFTC Presentation - Building a WP7 app - Lessons learnedOrdina SOFTC Presentation - Building a WP7 app - Lessons learned
Ordina SOFTC Presentation - Building a WP7 app - Lessons learnedOrdina Belgium
 
Ordina SOFTC Presentation - Windows Phone 7 and the cloud
Ordina SOFTC Presentation - Windows Phone 7 and the cloudOrdina SOFTC Presentation - Windows Phone 7 and the cloud
Ordina SOFTC Presentation - Windows Phone 7 and the cloudOrdina Belgium
 
Ordina SOFTC Presentation - Moving a legacy application into the cloud
Ordina SOFTC Presentation - Moving a legacy application into the cloudOrdina SOFTC Presentation - Moving a legacy application into the cloud
Ordina SOFTC Presentation - Moving a legacy application into the cloudOrdina Belgium
 
Ordina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and WorkflowOrdina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and WorkflowOrdina Belgium
 
Ordina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better togetherOrdina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better togetherOrdina Belgium
 

Más de Ordina Belgium (15)

Ordina SOFTC Presentation - UsingGeoData_ReportBuilder
Ordina SOFTC Presentation - UsingGeoData_ReportBuilderOrdina SOFTC Presentation - UsingGeoData_ReportBuilder
Ordina SOFTC Presentation - UsingGeoData_ReportBuilder
 
Ordina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deploymentOrdina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deployment
 
Ordina SOFTC Presentation - Developing against SharePoint 2010 Lists
Ordina SOFTC Presentation - Developing against SharePoint 2010 ListsOrdina SOFTC Presentation - Developing against SharePoint 2010 Lists
Ordina SOFTC Presentation - Developing against SharePoint 2010 Lists
 
Ordina SOFTC Presentation - SharePoint 2010 Architecture
Ordina SOFTC Presentation - SharePoint 2010 ArchitectureOrdina SOFTC Presentation - SharePoint 2010 Architecture
Ordina SOFTC Presentation - SharePoint 2010 Architecture
 
Ordina SOFTC Presentation - Office 365
Ordina SOFTC Presentation - Office 365Ordina SOFTC Presentation - Office 365
Ordina SOFTC Presentation - Office 365
 
Ordina SOFTC Presentation - Desktop Virtualization
Ordina SOFTC Presentation - Desktop VirtualizationOrdina SOFTC Presentation - Desktop Virtualization
Ordina SOFTC Presentation - Desktop Virtualization
 
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
 
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
Ordina SOFTC Presentation - Demand management using workflow Project Server 2010
 
Ordina SOFTC Presentation - Bridging the project and work management gap
Ordina SOFTC Presentation - Bridging the project and work management gapOrdina SOFTC Presentation - Bridging the project and work management gap
Ordina SOFTC Presentation - Bridging the project and work management gap
 
Ordina SOFTC Presentation - Visual Studio LightSwitch
Ordina SOFTC Presentation - Visual Studio LightSwitchOrdina SOFTC Presentation - Visual Studio LightSwitch
Ordina SOFTC Presentation - Visual Studio LightSwitch
 
Ordina SOFTC Presentation - Building a WP7 app - Lessons learned
Ordina SOFTC Presentation - Building a WP7 app - Lessons learnedOrdina SOFTC Presentation - Building a WP7 app - Lessons learned
Ordina SOFTC Presentation - Building a WP7 app - Lessons learned
 
Ordina SOFTC Presentation - Windows Phone 7 and the cloud
Ordina SOFTC Presentation - Windows Phone 7 and the cloudOrdina SOFTC Presentation - Windows Phone 7 and the cloud
Ordina SOFTC Presentation - Windows Phone 7 and the cloud
 
Ordina SOFTC Presentation - Moving a legacy application into the cloud
Ordina SOFTC Presentation - Moving a legacy application into the cloudOrdina SOFTC Presentation - Moving a legacy application into the cloud
Ordina SOFTC Presentation - Moving a legacy application into the cloud
 
Ordina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and WorkflowOrdina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and Workflow
 
Ordina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better togetherOrdina SOFTC Presentation - TFS and JAVA, better together
Ordina SOFTC Presentation - TFS and JAVA, better together
 

Ordina SOFTC Presentation - SQL CLR

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.

Notas del editor

  1. Technology for hosting the Microsoft .NET Common Language Runtime engine within SQL Server.Allows managed code to be hosted by and run in the Microsoft SQL Server environment.Alternative for T-SQL and XpsReplace Extended SP’s with a safer alternativeReplace COM automation: sp_OA_*Complex T-SQL algoritmsrecommended replacement for xp_cmdshellT-SQLDevelopers should view the CLR as an efficient alternative for logic that cannot be expressed declaratively in the query languageFor all the other logic, T-SQL will be sufficient.Hosting layer provides coordination of:Assembly LoadingMemory managementSecurity ModelReliabilityThreads & FibersDeadlock detectionExecution context
  2. Bigger Programmer productivity.Enhanced programming model: .NET Framework languages are richer than T-SQL ,offering capabilities not available to SQL developers. Enhanced safety and security: Managed code runs in a CLR environment, hosted by the database engine. Allows .NET Framework database objects to be safer and more secure than extended stored procedures.Common development environment:Database development integrated into Visual Studio development environment. same tools available for dev and debugging as in other .NET devs.Performance and scalability:managed code compiles to native code prior to execution, => significant performance increases in some scenarios.
  3. Stored procedures (SPs) which are analogous to procedures or void functions in procedural languages like VB or C,triggers which are stored procedures that fire in response to Data Manipulation Language (DML) or Data Definition Language (DDL) events,User-defined functions (UDFs) => scalare and table functions, which are analogous to functions in procedural languages,User-defined aggregates (UDAs) which allow developers to create custom aggregates that act on sets of data instead of one row at a time,User-defined types (UDTs) that allow users to create simple or complex data types which can be serialized and deserialized within the database
  4. Function => 1 Scalar => regex function 2 table valuedStored procedure => Read csv files on a shared location and load the data into the database Example: A company has several store locations. Each location has a disconnected ticking system, out of which CSV files with personall ticking times are generated. These files are then posted on an FTP server. \\\\ord01170\\Tickings is the share to the shared locationEmployeeTickings is the table to insert inOur CLR stored procedure will read the files on the shared directory and upload them into the central system in order to calculate the hours worked by personnel. UDT = > currency
  5. Be very carfull when using UNSAFE, you can do anything with it, so KNOW YOUR CODE!
  6. Short demo showing turning on SQLCLR in SSMSBy default CLR Integration is turned offTurn on via the Surface Area Configuration Manager, orRight-Click Database ServerSelect FacetsSelect Surface Area ConfigurationSet ClrIntegrationEnabled to TrueTransact SQL (T-SQL) Assembly InstallationOnce we have coded our C# assembly, we need to get it installed onto our SQL Server instance.The following steps need to be executed to install your CLR Code into SQL ServerAllow SQL Server to run CLR CodeWrite you code in C# or Vb.netCompile your codeLoad the assembly into SQL ServerCreate the database object and point it to the assemblySince we create our examples in Visual Studio, deployment of CLR assemblies to your database is even made easier. When you have created your code, you can compile and just Right Click and the Select DEPLOY in your project. (I will demonstrate this.)CREATE ASSEMBLY CLRDemo FROM 'C:\\MyAssemblyPath\\CLRDemo.dll'WITH PERMISSION_SET = SAFE;
  7. Demo it via T-SQL and via SSMS
  8. Like in all other .NET developments, you can set configurations to be used in your assemblies…In sql clr, configuration can always be done like we know it in genuine .NET develepment…. By using a configuration file.However, since we are in SQL Clr, the assembly is uploaded into a SQL Server database, where it is stored in the system catalogs using the CREATE ASSEMBLY data definition language (DDL) statement.This has the nasty side effect that we can only use the configuration file when it is called sqlserver.exe.config!In order to get the configuration even to work for our assemblies, we need to restart the SQL ServerIf you do not want to have your production server rebooted each time you deploy configuration changes, there is a better practice to have your configuration done in a dynamic way. Use a table, which you can call configuration for example and store your keys and values in there. This way, you can add, change configuration keys when necessary, without having to restart your SQL Server.
  9. When you decide to look at CLR, you can ask yourself some of the following questions, to help you decide wether or not you should use CLR...Set based: Selecting, filtering, sorting Versioning