csharp Microsoft.SqlServer.Server.SqlPipe类(方法)实例源码

下面列出了csharp Microsoft.SqlServer.Server.SqlPipe 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:Microsoft.SqlServer.Serve   
[Microsoft.SqlServer.Server.SqlProcedure()]
public static void StoredProcExecuteCommand(int rating)
{
    // Connect through the context connection.
    using (SqlConnection connection = new SqlConnection("context connection=true"))
    {
        connection.Open();

        SqlCommand command = new SqlCommand(
            "SELECT VendorID, AccountNumber, Name FROM Purchasing.Vendor " +
            "WHERE CreditRating <= @rating", connection);
        command.Parameters.AddWithValue("@rating", rating);

        // Execute the command and send the results directly to the client.
        SqlContext.Pipe.ExecuteAndSend(command);
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号