Search code examples
sql-serversql-server-2008

What is the purpose of ASSEMBLIES in SQL Server?


I am working on a Third Party Software build on SQL Server database. Noticed they have user defined / developed assemblies under the ASSEMBLIES Folder.

Default is Microsoft.SqlServer.Types

What is the purpose of SQL Server assemblies? How do we read it? It is possible to call an assembly as SELECT * FROM ASSEMBLYNAME ( Something like that ).


Solution

  • Assemblies (and CREATE ASSEMBLY) are used to

    Creates a managed application module that contains class metadata and managed code as an object in an instance of SQL Server. By referencing this module, common language runtime (CLR) functions, stored procedures, triggers, user-defined aggregates, and user-defined types can be created in the database.

    CREATE ASSEMBLY uploads an assembly that was previously compiled as a .dll file from managed code for use inside an instance of SQL Server.

    Assemblies are .NET dll's which are then imported into SQL Server where you can use them within SQL syntax.

    If your assembly contains a function, you can use it in SELECT clause. That assembly might, for example, be used to access files structure or do other things that are normally not available in SQL Server.

    You can learn more on MSDN.