Sign In
SQL Server 2005: CLR Integration
Samples, tips and tricks, insights from the CLR Integration team at SQL Server.
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
Pages
Archive
Archives
November 2006
(1)
October 2006
(1)
July 2006
(2)
June 2006
(8)
April 2006
(2)
March 2006
(3)
February 2006
(2)
November 2005
(3)
October 2005
(2)
July 2005
(1)
June 2005
(3)
May 2005
(4)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
SQL Server 2005: CLR Integration
Dynamic Assembly Loading II: SGen and System Defined Classes
Posted
over 6 years ago
by
Steven Hemingray
1
Comments
Today we’ll look at an example where sgen did not solve the problem with a dynamically loaded XmlSerializers assembly. This issue was found by a customer and filed as a bug on the Microsoft Connect site for SQL Server: http://connect.microsoft.com/SQLServer...
SQL Server 2005: CLR Integration
Dynamic Assembly Loading
Posted
over 6 years ago
by
Steven Hemingray
0
Comments
Simple question: what security permission level is required to allow dynamic loading of assemblies? Trick question: dynamic assembly loading is always disallowed under SQL CLR, even under UNSAFE. This is mentioned twice in BOL: CLR Integration...
SQL Server 2005: CLR Integration
Deadlock Detection in SQL CLR
Posted
over 6 years ago
by
Steven Hemingray
1
Comments
Usually, talking about the differences between running code under the CLR vs. running under SQL CLR focuses on functionality that either doesn’t work or is difficult to use in a safe and reliable manner. However, one feature that SQL Server actually adds...
SQL Server 2005: CLR Integration
SQL Server 2005 Debugging Requirements
Posted
over 6 years ago
by
sqlclr
11
Comments
There have been some questions about the sysadmin requirement of SQL Server 2005 Debugging, and I’d like to explain it in some details. When you debug T-SQL or CLR code in SQL Server 2005, there are two users involved: user running the debugger and user...
SQL Server 2005: CLR Integration
Exception handling in SQLCLR
Posted
over 6 years ago
by
sqlclr
2
Comments
Naveen covered the TSQL exception handling in his posts on sqlprogrammability blog site. How does the TSQL exception handling mechanism interacts with SQLCLR exception handling mechanism? We will cover this topic in this post. When SQL server execute...
SQL Server 2005: CLR Integration
Overview of T-SQL and CLR debugging in SQL Server 2005
Posted
over 6 years ago
by
sqlclr
15
Comments
SQL Server 2005 ships with a new debugging engine that supports debugging of any T-SQL and CLR code running in the server, including batches, stored procedures, user defined functions/aggregates/triggers, etc. You can use Visual Studio 2005 to debug against...
SQL Server 2005: CLR Integration
Strong named assemblies and AllowPartiallyTrustedCallers
Posted
over 6 years ago
by
sqlclr
1
Comments
Very often, you may wish to factor out your code into separate assemblies in your application. For example, you separate your type in one assembly because it gets used by multiple areas in your application. And you save your proc that uses that type in...
SQL Server 2005: CLR Integration
Creating a CLR user define aggregate (part 2). Use multiple columns in the aggregation function
Posted
over 6 years ago
by
sqlclr
1
Comments
In part 1 we created a nice user defined aggregate. Now we are going to make it more sophisticated and let its value depend on two parameters ShipCountry and ShipShipCity. You might try having two parameters in Accumulate function of the aggregate but...
SQL Server 2005: CLR Integration
Creating a CLR user define aggregate (part 1). Simple CLR aggregate
Posted
over 6 years ago
by
sqlclr
7
Comments
SQL Server 2005 allows creating of User Defined Aggregate in any of the .NET languages such as C# or VB. For simple cases like SUM or MAX you probably want to use built-in aggregates, however there are cases where build-ins are insufficient. In such cases...
SQL Server 2005: CLR Integration
Impersonation in SQL CLR
Posted
over 6 years ago
by
sqlclr
5
Comments
When the user code will try to access a resource outside of the SQL server it will run in the security context under which SQL Server is running. But this is not the ideal situation since it could become a security issue when the logged user that calls...
SQL Server 2005: CLR Integration
Assembly redirection and CLR Integration
Posted
over 6 years ago
by
sqlclr
5
Comments
Assembly redirection is not supported in SQL CLR. Assembly redirection can be done using publisher, application configuration and machine configuration files. SQL Server 2005 uses application configuration to redirect assembly call after Alter Assembly...
SQL Server 2005: CLR Integration
Satellite assemblies in SQL Server 2005
Posted
over 6 years ago
by
sqlclr
1
Comments
This is a sample on how to register satellite assemblies in SQL Server 2005. Based on the CultureInfo on the executing thread, CLR will try to load the respective resource assembly. It should not be a difference between satellite assemblies inside...
SQL Server 2005: CLR Integration
How to tell if your code should be yielding
Posted
over 6 years ago
by
Steven Hemingray
1
Comments
As we saw in the last post, cooperative clr code that explicitly yields during long-running computations outperforms clr code that gets forcibly rescheduled. How should one discover sql/clr code that is considered 'runaway' by the server and could be...
SQL Server 2005: CLR Integration
Who says tough guys never yield?
Posted
over 6 years ago
by
Steven Hemingray
0
Comments
Perhaps you've seen the following note in BOL advising SQLCLR users to explicitly yield in their long-running CLR functions: "Long-running managed code that accesses data or allocates enough memory to trigger garbage collection will yield automatically...
SQL Server 2005: CLR Integration
Memory Usage in SQL CLR
Posted
over 6 years ago
by
Steven Hemingray
4
Comments
There are two important memory considerations you may want to track when using SQL CLR functionality: 1) How much memory is SQL CLR using? And 2) How much memory is SQL CLR allowed to use? The answer to the first question is pretty easy to answer...
SQL Server 2005: CLR Integration
Now THAT's a Sample!
Posted
over 6 years ago
by
Steven Hemingray
0
Comments
Perhaps you’ve heard all about the power and flexibility .NET framework integration provides in Sql Server, read the news articles, seen the example code on blogs, but yet you are still unsure on what benefits it can provide. Some of the best demonstration...
SQL Server 2005: CLR Integration
UDT Execute Permission
Posted
over 6 years ago
by
Steven Hemingray
0
Comments
The required cases for execute permission on UDFs and UDPs are pretty understandable, however the situation for a UDT is not quite so clear-cut. What does “Execute” really mean in the context of a UDT anyway? Simply put, execute permission is required...
SQL Server 2005: CLR Integration
I found my appdomain, now what?
Posted
over 6 years ago
by
Steven Hemingray
0
Comments
From the query I described yesterday, here are the different possible appdomain states and what they represent: Appdomain initialization: E_APPDOMAIN_CREATING – Creating the appdomain Appdomain in use: E_APPDOMAIN_SHARED – A Runtime...
SQL Server 2005: CLR Integration
It’s 3 AM. Do you know where your appdomain is?
Posted
over 6 years ago
by
Steven Hemingray
1
Comments
The dmv sys.dm_clr_appdomains is a great way to find information about the appdomains currently loaded in the system, but it doesn’t help if the appdomain in question has already been unloaded. For those DBAs who want to track their appdomains like their...
SQL Server 2005: CLR Integration
CLR Trigger for Automatic Registration of UDXs on CREATE ASSEMBLY
Posted
over 7 years ago
by
Miles Trochesset
6
Comments
Using a CLR trigger we can register all user defined functions, procedures, types, aggregates etc., contained in an assembly when it is created in the database on "CREATE ASSEMBLY ... ". This saves us the time of registering all these ourselfves. We skip...
SQL Server 2005: CLR Integration
Best Week Ever
Posted
over 7 years ago
by
sqlclr
11
Comments
SQL Server provides the ability to find the week of the year in which a given date lies. For example: declare @d datetime set @d = '13 november 2005' select datepart(ww, @d) The result of this is 47. Now, the problem with this is that the...
SQL Server 2005: CLR Integration
Serialization and Ordering: An Integral Example
Posted
over 7 years ago
by
sqlclr
5
Comments
Some people peeked (and poked) under the covers and have been surprised at how SQL Server is twiddling their UDT bits during serialization. Let's peek together. Consider the following fragment of a UDT: [Microsoft.SqlServer.Server.SqlUserDefinedType...
SQL Server 2005: CLR Integration
Tutorial on SqlClr Computed Columns and Indexability
Posted
over 7 years ago
by
sqlclr
1
Comments
Restrictive world of SqlClr computed columns and indexability With Yukon entering the world of managed code, the world of indexes has just become a tad bit complicated but hey we are talking about smart/passionate Sql Server customers here – I am...
SQL Server 2005: CLR Integration
Using Webservices and Xml Serialization in CLR Integration
Posted
over 7 years ago
by
sqlclr
26
Comments
Last time we saw an example of using a powerful functionality, Regular Expressions, from a supported .NET Framework library and how you can leverage it in your database applications. Today we will talk about another such functionality that is enabled...
SQL Server 2005: CLR Integration
Working with Regular Expressions
Posted
over 7 years ago
by
sqlclr
8
Comments
One of the many benefits of using CLR Integration in your database applications is the availability of rich .NET Framework libraries. SQL Server provides you with a set of built-in functions that can be used in your queries but with CLR Integration you...
Page 1 of 2 (31 items)
1
2
MSDN Blogs
>
SQL Server 2005: CLR Integration