Microsoft.SqlServer.Server Namespace

Microsoft.SqlServer.Server 命名空间包含将 Microsoft .NET Framework 公共语言运行时 (CLR) 集成到 Microsoft SQL Server 和 SQL Server 数据库引擎进程执行环境时所要用到的类、接口和枚举。 The Microsoft.SqlServer.Server namespace contains classes, interfaces, and enumerations that are specific to the integration of the Microsoft .NET Framework common language runtime (CLR) into Microsoft SQL Server, and the SQL Server database engine process execution environment.

InvalidUdtException

在 SQL Server 或 ADO.NET System.Data.SqlClient 提供程序检测到无效的用户定义类型 (UDT) 时引发。 Thrown when SQL Server or the ADO.NET System.Data.SqlClient provider detects an invalid user-defined type (UDT).

SqlContext

表示调用方上下文的抽象,该上下文提供对 SqlPipeSqlTriggerContextWindowsIdentity 对象的访问。 Represents an abstraction of the caller's context, which provides access to the SqlPipe, SqlTriggerContext, and WindowsIdentity objects. 此类不能被继承。 This class cannot be inherited.

SqlDataRecord

表示单个数据行及其元数据。 Represents a single row of data and its metadata. 此类不能被继承。 This class cannot be inherited.

SqlFacetAttribute

使用可用在 Transact-SQL 中的其他信息对用户定义类型 (UDT) 的返回结果进行批注。 Annotates the returned result of a user-defined type (UDT) with additional information that can be used in Transact-SQL.

SqlFunctionAttribute

用于将用户定义聚合的方法定义标记为 SQL Server 中的函数。 Used to mark a method definition of a user-defined aggregate as a function in SQL Server. 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特征。 The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server.

SqlMetaData

SqlDataRecord 对象的参数和列指定和检索元数据信息。 Specifies and retrieves metadata information from parameters and columns of SqlDataRecord objects. 此类不能被继承。 This class cannot be inherited.

SqlMethodAttribute

指示用户定义类型 (UDT) 的方法或属性的确定性和数据访问性质。 Indicates the determinism and data access properties of a method or property on a user-defined type (UDT). 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特性。 The properties on the attribute reflect the physical characteristics that are used when the type is registered with SQL Server.

SqlPipe

允许托管存储过程在 SQL Server 数据库上进行进程内运行,以便将结果返回调用方。 Allows managed stored procedures running in-process on a SQL Server database to return results back to the caller. 此类不能被继承。 This class cannot be inherited.

SqlProcedureAttribute

用于将程序集中的方法定义标记为存储过程。 Used to mark a method definition in an assembly as a stored procedure. 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特征。 The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. 此类不能被继承。 This class cannot be inherited.

SqlTriggerAttribute

用于将程序集中的方法定义标记为 SQL Server 中的触发器。 Used to mark a method definition in an assembly as a trigger in SQL Server. 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特性。 The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. 此类不能被继承。 This class cannot be inherited.

SqlTriggerContext

提供所激发的触发器的上下文信息。 Provides contextual information about the trigger that was fired.

SqlUserDefinedAggregateAttribute

指示类型应注册为用户定义的聚合。 Indicates that the type should be registered as a user-defined aggregate. 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特性。 The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. 此类不能被继承。 This class cannot be inherited.

SqlUserDefinedTypeAttribute

用于将程序集中的类型定义标记为 SQL Server 中的用户定义类型 (UDT)。 Used to mark a type definition in an assembly as a user-defined type (UDT) in SQL Server. 该特性的属性反映了向 SQL Server 注册该类型时所使用的实体特征。 The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. 此类不能被继承。 This class cannot be inherited.

界面

IBinarySerialize

为用户定义类型 (UDT) 和用户定义聚合的序列化和反序列化提供自定义实现。 Provides custom implementation for user-defined type (UDT) and user-defined aggregate serialization and deserialization.

枚举

DataAccessKind

描述用户定义的方法或函数所使用的用户数据访问类型。 Describes the type of access to user data for a user-defined method or function.

Format

SqlUserDefinedTypeAttributeSqlUserDefinedAggregateAttribute 用来指示用户定义类型 (UDT) 或聚合的序列化格式。 Used by SqlUserDefinedTypeAttribute and SqlUserDefinedAggregateAttribute to indicate the serialization format of a user-defined type (UDT) or aggregate.

SystemDataAccessKind

描述用户定义的方法或函数对系统数据的访问类型。 Describes the type of access to system data for a user-defined method or function.

TriggerAction

TriggerAction 枚举由 SqlTriggerContext 类用来指示激发该触发器的操作。 The TriggerAction enumeration is used by the SqlTriggerContext class to indicate what action fired the trigger.

注解

使用属性中的类Microsoft.SqlServer.Server命名空间中,您可以创建存储的过程、 触发器、 用户定义类型、 用户定义的函数 (标量和表值) 和用户定义的聚合函数中任何受支持的.NET Framework语言。Using the attribute classes in the Microsoft.SqlServer.Server namespace, you can create stored procedures, triggers, user-defined types, user-defined functions (both scalar and table-valued), and user-defined aggregate functions in any supported .NET Framework language. 此外可以在 SQL Server 中注册它们。You can also register them in SQL Server.

查询SqlContext类来确定是否在 SQL Server 数据库引擎进程中运行当前正在执行的代码。Query the SqlContext class to determine whether the currently executing code is running in the SQL Server database engine process. 当用户在服务器上,调用托管存储的过程或函数时或当用户执行任何操作触发了托管的代码触发器时,这也会提供调用方的上下文。This also provides the caller's context when a user calls a managed stored procedure or function on the server, or when a user's action fires a managed code trigger.

SqlContext类提供了SqlPipe对象,通过该结果返回到客户端从存储过程SqlTriggerContext对象,它提供有关导致触发器激发的操作的信息,和一个WindowsIdentity对象,该对象可用于确定客户端使用集成的安全性身份验证时调用的客户端的标识。The SqlContext class provides a SqlPipe object, through which results are returned to the client from a stored procedure, a SqlTriggerContext object, which provides information about the operation that caused a trigger to be fired, and a WindowsIdentity object, which can be used to determine the identity of the calling client when the client used integrated security for authentication.

有关 SQL Server CLR 集成和中的 Api 详细信息Microsoft.SqlServer.Server命名空间,请参阅SQL Server 文档For more information about SQL Server CLR integration and the APIs in the Microsoft.SqlServer.Server namespace, see SQL Server Documentation.