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 1038651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:00:07+00:00 2026-05-16T15:00:07+00:00

This may be naive but I cannot get any confirmation of this: When I

  • 0

This may be naive but I cannot get any confirmation of this: When I write a SQL function via the SQLCLR and as a C# SQL Server Project, can the SQL function include any method/class/namespace in the .NET BCL? Are there any restrictions on what the function can do? I have full control of the SQL Server and its hosting OS, so I can amend security settings at that level. I am more interested in the language support for C# in a SQLCLR user-defined function (SQL project).

My final deployment of code will be on SQL Server 2005 and 2008 R2 (Enterprise Edition). As 2008 R2 would be a development on 2005 in terms of features and support, 2005 is my common denominator, hence I am interested in answers on 2005.

Thanks

  • 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-05-16T15:00:07+00:00Added an answer on May 16, 2026 at 3:00 pm

    It can not. You can’t use classes that have a [HostProtection] attribute that marks the class as unsafe. Details are in this MSDN Library article, it includes lists of classes that are off limits.

    The classic example of such a class is TimeZoneInfo, it loads an unmanaged DLL that won’t be unloaded if there’s a query abort.

    [HostProtection(SecurityAction.LinkDemand, MayLeakOnAbort=true)]
    public sealed class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
    {
      // etc...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a pretty naive and stupid question, but I'm going to ask
This may be a terribly naive question but I was just wondering if the
This may be a naive question, but does RSpec's testing DSL violate the law
This question may be naive, but: is there const keyword in C? since which
this may be a naive question, but, as asked in the object, what is
This question may seem to be naive. But I think it'll be much worse
This may seem like a simple question but i am getting an error when
This may be rather noobish but I'm gonna ask anyhow. I have a class
This may seem really silly to you, I admit, but when discussing the Model-View-ViewModel
This may be silly, but it's been nagging the back of my brain for

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.