anchor.diff:              assert (rank = ResultRank.Sequence)
               box xs 
   
  -    let internal executeNonQuery(cmd, _, parameters) = 
  -        setParameters cmd parameters  
  +    static member ExecuteNonQuery(cmd, _, parameters) = 
  +        SqlCommand<_>.SetParameters(cmd, parameters)  
           use openedConnection = cmd.Connection.UseLocally()
           cmd.ExecuteNonQuery() 
   
  -    let internal asyncExecuteNonQuery(cmd, _, parameters) = 
  -        setParameters cmd parameters  
  +    static member AsyncExecuteNonQuery(cmd, _, parameters) = 
  +        SqlCommand<_>.SetParameters(cmd, parameters)  
           async {         
               use openedConnection = cmd.Connection.UseLocally()
               return! cmd.AsyncExecuteNonQuery() 
           }
   
  -    let getExecuteImplementations<'TItem>(cmd, resultType, rank, rowMapping) = 
  +    static member GetExecuteImplementations(cmd, resultType, rank, rowMapping) = 
           match resultType with
           | ResultType.Records | ResultType.Tuples ->
               if box rowMapping = null
               then
  -                executeNonQuery >> box, asyncExecuteNonQuery >> box
  +                SqlCommand<_>.ExecuteNonQuery >> box, SqlCommand<_>.AsyncExecuteNonQuery >> box
               else
  -                executeSeq<'TItem> (rank, rowMapping) >> box, asyncExecuteSeq<'TItem> (rank, rowMapping) >> box
  +                SqlCommand<_>.ExecuteSeq<'TItem1> (rank, rowMapping) >> box, SqlCommand<_>.AsyncExecuteSeq<'TItem1> (rank, rowMapping) >> box
           | ResultType.DataTable ->
  -            executeDataTable >> box, asyncExecuteDataTable >> box
  +            SqlCommand<_>.ExecuteDataTable >> box, SqlCommand<_>.AsyncExecuteDataTable >> box
           | ResultType.DataReader -> 
  -            executeReader >> box, asyncExecuteReader >> box
  +            SqlCommand<_>.ExecuteReader >> box, SqlCommand<_>.AsyncExecuteReader >> box
           | unexpected -> failwithf "Unexpected ResultType value: %O" unexpected
   
  -type Connection =
  -    | Literal of string
  -    | NameInConfig of string
  -    | Transaction of SqlTransaction
  -
  -type SqlCommand<'TItem> (connection, sqlStatement, isStoredProcedure, parameters, resultType, rank, rowMapping: RowMapping) = 
  -
  -    let cmd = new SqlCommand(sqlStatement, CommandType = if isStoredProcedure then CommandType.StoredProcedure else CommandType.Text)
  -    do 
  -        match connection with
  -        | Literal value -> 
  -            cmd.Connection <- new SqlConnection(value)
  -        | NameInConfig name ->
  -            let connStr = Configuration.GetConnectionStringAtRunTime name
  -            cmd.Connection <- new SqlConnection(connStr)
  -        | Transaction t ->
  -             cmd.Connection <- t.Connection
  -             cmd.Transaction <- t
  -
  -    do
  -        cmd.Parameters.AddRange( parameters)
  -
  -    let getReaderBehavior() = 
  -        seq {
  -            yield CommandBehavior.SingleResult
  -
  -            if cmd.Connection.State <> ConnectionState.Open 
  -            then
  -                cmd.Connection.Open() 
  -                yield CommandBehavior.CloseConnection
  -
  -            if rank = ResultRank.SingleRow then yield CommandBehavior.SingleRow 
  -
  -            if resultType = ResultType.DataTable then yield CommandBehavior.KeyInfo
  -        }
  -        |> Seq.reduce (|||) 
  -
  -    let execute, asyncExecute = SqlCommand.getExecuteImplementations<'TItem>(cmd, resultType, rank, rowMapping)
  -
  -    member this.AsSqlCommand() = 
  -        let clone = new SqlCommand(cmd.CommandText, new SqlConnection(cmd.Connection.ConnectionString), CommandType = cmd.CommandType)
  -        clone.Parameters.AddRange <| [| for p in cmd.Parameters -> SqlParameter(p.ParameterName, p.SqlDbType) |]
  -        clone
  -
  -    interface ISqlCommand with
  -
  -        member this.Execute parameters = execute(cmd, getReaderBehavior, parameters)
  -        member this.AsyncExecute parameters = asyncExecute(cmd, getReaderBehavior, parameters)
  -
  -        member this.ToTraceString parameters =  
  -            let clone = this.AsSqlCommand()
  -            SqlCommand.setParameters clone parameters  
  -            let parameterDefinition (p : SqlParameter) =
  -                if p.Size <> 0 then
  -                    sprintf "%s %A(%d)" p.ParameterName p.SqlDbType p.Size
  -                else
  -                    sprintf "%s %A" p.ParameterName p.SqlDbType 
  -            seq {
  -              yield sprintf "exec sp_executesql N'%s'" clone.CommandText
  -              
  -              yield clone.Parameters
  -                    |> Seq.cast<SqlParameter> 
  -                    |> Seq.map parameterDefinition
  -                    |> String.concat ","
  -                    |> sprintf "N'%s'" 
  -              yield parameters
  -                    |> Seq.map(fun (name,value) -> sprintf "%s='%O'" name value) 
  -                    |> String.concat ","
  -            } |> String.concat "," //Using string.concat to handle annoying case with no parameters
  -
  -        member this.Raw = cmd
  -            
  -    interface IDisposable with
  -        member this.Dispose() =
  -            cmd.Dispose()
  -
  +
  
positive.code:     | SingleRow = 1
      | ScalarValue = 2
  
  module SqlCommand = 
  
      let internal setParameters (cmd: SqlCommand) (parameters: (string * obj)[]) = 
          for name, value in parameters do
              
              let p = cmd.Parameters.[name]            
  
negative.code:                 | SqlDbType.VarChar -> p.Size <- 8000
                  | _ -> ()
  
      static member ExecuteReader(cmd, getReaderBehavior, parameters) = 
          SqlCommand<_>.SetParameters(cmd, parameters)
          cmd.ExecuteReader( getReaderBehavior())
  
      static member AsyncExecuteReader(cmd, getReaderBehavior, parameters) = 
          SqlCommand<_>.SetParameters(cmd, parameters)
          cmd.AsyncExecuteReader( getReaderBehavior())
      
      static member ExecuteDataTable(cmd, getReaderBehavior, parameters) = 
          use reader = SqlCommand<_>.ExecuteReader(cmd, getReaderBehavior, parameters)  
          let result = new FSharp.Data.DataTable<DataRow>()
          result.Load(reader)
          result
  
      static member AsyncExecuteDataTable(cmd, getReaderBehavior, parameters) = 
          async {
              use! reader = SqlCommand<_>.AsyncExecuteReader(cmd, getReaderBehavior, parameters) 
              let result = new FSharp.Data.DataTable<DataRow>()
              result.Load(reader)
              return result
          }
  
      static member ExecuteSeq<'TItem> (rank, rowMapper) (cmd, getReaderBehavior, parameters) = 
          let xs = SqlCommand<_>.ExecuteReader(cmd, getReaderBehavior, parameters) |> Seq.ofReader<'TItem> rowMapper
  
          if rank = ResultRank.SingleRow 
          then 
  