TechNet
Export (0) Print
Expand All

Microsoft.SqlServer.Server Namespace

 

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.

ClassDescription
System_CAPS_pubclassInvalidUdtException

Thrown when SQL Server or the ADO.NET System.Data.SqlClient provider detects an invalid user-defined type (UDT).

System_CAPS_pubclassSqlContext

Represents an abstraction of the caller's context, which provides access to the SqlPipe, SqlTriggerContext, and WindowsIdentity objects. This class cannot be inherited.

System_CAPS_pubclassSqlDataRecord

Represents a single row of data and its metadata. This class cannot be inherited.

System_CAPS_pubclassSqlFacetAttribute

Annotates the returned result of a user-defined type (UDT) with additional information that can be used in Transact-SQL.

System_CAPS_pubclassSqlFunctionAttribute

Used to mark a method definition of a user-defined aggregate as a function in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server.

System_CAPS_pubclassSqlMetaData

Specifies and retrieves metadata information from parameters and columns of SqlDataRecord objects. This class cannot be inherited.

System_CAPS_pubclassSqlMethodAttribute

Indicates the determinism and data access properties of a method or property on a user-defined type (UDT). The properties on the attribute reflect the physical characteristics that are used when the type is registered with SQL Server.

System_CAPS_pubclassSqlPipe

Allows managed stored procedures running in-process on a SQL Server database to return results back to the caller. This class cannot be inherited.

System_CAPS_pubclassSqlProcedureAttribute

Used to mark a method definition in an assembly as a stored procedure. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. This class cannot be inherited.

System_CAPS_pubclassSqlTriggerAttribute

Used to mark a method definition in an assembly as a trigger in 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.

System_CAPS_pubclassSqlTriggerContext

Provides contextual information about the trigger that was fired.

System_CAPS_pubclassSqlUserDefinedAggregateAttribute

Indicates that the type should be registered as a user-defined aggregate. The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. This class cannot be inherited.

System_CAPS_pubclassSqlUserDefinedTypeAttribute

Used to mark a type definition in an assembly as a user-defined type (UDT) in 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.

InterfaceDescription
System_CAPS_pubinterfaceIBinarySerialize

Provides custom implementation for user-defined type (UDT) and user-defined aggregate serialization and deserialization.

EnumerationDescription
System_CAPS_pubenumDataAccessKind

Describes the type of access to user data for a user-defined method or function.

System_CAPS_pubenumFormat

Used by SqlUserDefinedTypeAttribute and SqlUserDefinedAggregateAttribute to indicate the serialization format of a user-defined type (UDT) or aggregate.

System_CAPS_pubenumSystemDataAccessKind

Describes the type of access to system data for a user-defined method or function.

System_CAPS_pubenumTriggerAction

The TriggerAction enumeration is used by the SqlTriggerContext class to indicate what action fired the trigger.

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. You can also register them in 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.

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.

For more information about SQL Server CLR integration and the APIs in the Microsoft.SqlServer.Server namespace, see SQL Server Books Online.

Return to top
Show:
© 2016 Microsoft