Stairway to SQLCLR Level 1: What is SQLCLR?

  • Solomon Rutzky

    SSCoach

    Points: 15964

    copling (1/10/2014)


    Thanks for the reply. But what if the dll is a .net dll? You know in .net one assembly can have reference to another .net assembly; can the same functionality be done for a SQLCRL assembly?

    Hi there. I will cover this concept in a future article (or 2), but the simple answer is "Yes" and it is the same in all versions of SQL Server since SQLCLR was introduced in SQL 2005.

    The more complicated answer is: as usual, you need to add a reference to the DLL in your project. Now, if the DLL is a .Net framework DLL, then not all of them are natively available in SQL Server's restricted CLR. There is a list of which ones are valid and it is a rather short list. You can still use non-validated framework DLLs, but you need to import them into SQL Server in the manner shown by "currentp" and that can only be done if they are marked as UNSAFE. Does this answer the question?

    currentp (1/10/2014)


    ...

    -- Solomon Rutzky - I hope I'm not stealing your thunder 🙂

    Nope, not at all. Anyone is welcome to answer questions :-).

    Take care,

    Solomon..

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR

  • Jeff Moden

    SSC Guru

    Points: 994246

    I always wondered why the FORMAT function was so slow. Now I know. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

    Helpful Links:
    How to post code problems
    Create a Tally Function (fnTally)

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    A great basic article for a novice like me. Thanks.

  • Mark Dalley

    SSCrazy

    Points: 2550

    This is my sort of article. Starts off with a high level overview, says what it isn't as well as what it is, and gives some reasons why you might be motivated to look more closely at it.
    Quite different from the BOL approach, which immediately immerses the reader in a forest of details. Yes, the answer to one's question is almost certainly in there, but I have to wade through the details to get to it.
    Well done Solomon Rutzky.
    MarkD

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply