using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;


public partial class StoredProcedures
{
  [Microsoft.SqlServer.Server.SqlProcedure]
 public static void getAuthorsByState(SqlString state)
  {
    SqlConnection conn = new SqlConnection("context connection=true");
    conn.Open();
    SqlCommand cmd = conn.CreateCommand();
    cmd.CommandText = "select * from authors where state = @state";
    cmd.Parameters.Add("@state", SqlDbType.VarChar);
    cmd.Parameters[0].Value = state;
    SqlPipe pipe = SqlContext.Pipe;
    pipe.ExecuteAndSend(cmd);
  }

};
