Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:40:33+00:00 2026-06-16T03:40:33+00:00

SQL Server version: 2005 .NET version: 3.5 I’m trying to work with a CLR

  • 0

SQL Server version: 2005

.NET version: 3.5

I’m trying to work with a CLR UDF using the most efficient methods in regards to memory and performance. So it seems that SQL Server comes with pre-loaded .NET assemblies from the GAC. However, SQL server prohibits you from loading custom assemblies from the GAC to your SQL database. Trying to find an alternative approach to this, I experimented with SQL CLR by loading assemblies on a per database basis and ran SQL queries utilizing my CLR UDF to find that each database is assigned its own appdomain. In addition, each appdomain loads a copy of the assemblies (my main assembly with its dependencies). Makes sense.

OK, I then experimented with creating the assemblies into a single database and then referencing the CLR UDF via dbname.dbo.clrudfname in other databases to find something interesting. The only appdomain that loaded belongs to the database that hosts the assemblies. In addition, the only assemblies loaded are those that are hosted in that appdomain. In addition, performance was pretty much the same referencing another database’s assembly opposed to the database hosting its own copy.

Does anyone see an issue with this approach in managing CLR memory more efficiently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:40:35+00:00Added an answer on June 16, 2026 at 3:40 am

    There’s no reason to have duplicate assemblies on the same database server. That’s just extra copies to maintain.

    Create one database, called Utilities (or CLRs or whatever) and put the CLRs there. Then you can reference them with a 3 part name (db.schema.object) from any database on the server.

    Since you’re using CLRs, I’d recommend you review David Wiseman’s IO Utility solution here: http://www.wisesoft.co.uk/articles/sql_server_clr_io_utility.aspx

    It’s perfect for integrating the file system with T-SQL. It’s also great for beginners learning how to build CLRs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using sql-server 2005 and ASP.NET with C#. I have Users table with userId(int),
Does ADO.NET Entity Framework 4 work with SQL Server 2005? I'm having trouble getting
I am using these technologies: SQL Server 2005, ASP.NET MVC, NHibernate/sharp architecture and would
I am using SQL Server 2008 Enterprise version. I want to know if I
I am writing an ASP.NET app that uses a SQL Server 2005 with SSRS
I am developing an application in SQL Server using C#. My database version is
I'm trying to test a developer's application against a SQL Server 2005 database (80)
I am trying to pragmatically run a backup of an SQL Server database using
I need to determine the version of SQL Server (2000, 2005 or 2008 in
I installed SQL Server configuration manager and management studio version 2005, on windows 7

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.