SqlContextとは? わかりやすく解説

SqlContext クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

呼び出し元のコンテキスト抽象化し、SqlPipe、SqlTriggerContext、WindowsIdentity の各オブジェクトへのアクセス提供します。このクラス継承できません。

名前空間: Microsoft.SqlServer.Server
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public NotInheritable Class
 SqlContext
public sealed class SqlContext
public final class SqlContext
解説解説
使用例使用例

次の例では、新しい SqlDataRecord と、その SqlMetaData オブジェクト作成します。さらに、SendResultsStart メソッド結果セット先頭宣言しサンプルデータを含むレコードを、SendResultsRow メソッドクライアント返した後、結果セット最後に到達したことを、SendResultsEnd メソッド使って示してます。

<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub StoredProcReturnResultSet()

    ' Create the record and specify the metadata for the columns.
    Dim record As New SqlDataRecord(
 _
        New SqlMetaData("col1",
 SqlDbType.NVarChar, 100), _
        New SqlMetaData("col2",
 SqlDbType.Int))

    ' Mark the begining of the result-set.
    SqlContext.Pipe.SendResultsStart(record)

    ' Send 10 rows back to the client.
    Dim i As Integer
    For i = 0 To 9

        ' Set values for each column in the row.
        record.SetString(0, "row " & i.ToString())
        record.SetInt32(1, i)

        ' Send the row back to the client.
        SqlContext.Pipe.SendResultsRow(record)
    Next

    ' Mark the end of the result-set.
    SqlContext.Pipe.SendResultsEnd()
End Sub
[Microsoft.SqlServer.Server.SqlProcedure]
public static void StoredProcReturnResultSet()
{
    // Create the record and specify the metadata for the columns.
    SqlDataRecord record = new SqlDataRecord(
        new SqlMetaData("col1", SqlDbType.NVarChar,
 100),
        new SqlMetaData("col2", SqlDbType.Int));

    // Mark the begining of the result-set.
    SqlContext.Pipe.SendResultsStart(record);

    // Send 10 rows back to the client.
    for (int i = 0; i < 10; i++)
    {
        // Set values for each column in the row.
        record.SetString(0, "row " + i.ToString());
        record.SetInt32(1, i);

        // Send the row back to the client.
        SqlContext.Pipe.SendResultsRow(record);
    }

    // Mark the end of the result-set.
    SqlContext.Pipe.SendResultsEnd();
}
継承階層継承階層
System.Object
  Microsoft.SqlServer.Server.SqlContext
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SqlContext メンバ
Microsoft.SqlServer.Server 名前空間

SqlContext プロパティ


SqlContext メソッド


SqlContext メンバ

呼び出し元のコンテキスト抽象化し、SqlPipe、SqlTriggerContext、WindowsIdentity の各オブジェクトへのアクセス提供します。このクラス継承できません。

SqlContext データ型公開されるメンバを以下の表に示します


パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

SqlContext クラス
Microsoft.SqlServer.Server 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SqlContext」の関連用語

SqlContextのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SqlContextのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS