共用方式為


Managing CLR Integration Assemblies

更新: 2005 年 12 月 5 日

Managed code is compiled and then deployed in units called an assembly. An assembly is packaged as a DLL or executable (.exe) file. While an executable file can run on its own, a DLL must be hosted in an existing application. Managed DLL assemblies can be loaded into and hosted by Microsoft SQL Server 2005. SQL Server requires you to register the assembly in a SQL Server database using the CREATE ASSEMBLY statement, before it can be loaded in the process and used. Assemblies can also be updated from a more recent version using the ALTER ASSEMBLY statement, or removed from SQL Server using the DROP ASSEMBLY statement.

Assembly information is stored in the sys.assembly_files table in the database where the assembly has been installed. The sys.assembly_files table contains the following columns.

Column Description

assembly_id

The identifier defined for the assembly. This number is assigned to all objects relating to the same assembly.

name

The name of the object.

file_id

A number identifying each object, with the first object associated with a given assembly_id being given the value of 1. If multiple objects are associated with the same assembly_id, then each subsequent file_id value is incremented by 1.

content

The hexadecimal representation of the assembly or file.

The following table lists the topics in this section.

Topic Description

Creating an Assembly

Discusses creating SAFE, EXTERNAL_ACCESS, and UNSAFE CLR assemblies in SQL Server.

Altering an Assembly

Describes updating CLR assemblies in SQL Server.

Dropping an Assembly

Discusses dropping CLR assemblies from SQL Server.

Change History

Release History

2005 年 12 月 5 日

New content:
  • Added information on the sys.assembly_files table.
Updated content:
  • Updated and expanded the Managing CLR Integration Assemblies section.

請參閱

概念

CLR Integration Security
CLR Integration Code Access Security

說明及資訊

取得 SQL Server 2005 協助