anchor.diff:          conn.LoadDataTypesMap()
   
           let sqlParameters = this.ExtractSqlParameters(conn, commandText)
  -        
  +
           let outputColumns = 
               if resultType <> ResultType.DataReader
               then this.GetOutputColumns(conn, commandText, sqlParameters)
               else []
           
  -        let { ProvidedType = providedOutputType; ErasedToType = runtimeType; RowType = typeToAdd; MapperFromReader = mapper } as output 
  -            = this.GetReaderMapper(outputColumns, resultType, singleRow)
  -        
  -        let runtimeCommandType = typedefof<_ SqlCommand>.MakeGenericType( [| runtimeType |])
  -        let providedCommandType = ProvidedTypeDefinition(assembly, nameSpace, typeName, baseType = Some runtimeCommandType, HideObjectMethods = true)
  -        
  -        typeToAdd |> Option.iter providedCommandType.AddMember
  -
  -        ProvidedProperty( "ConnectionStringOrName", typeof<string>, [], IsStatic = true, GetterCode = fun _ -> <@@ connectionStringOrName @@>) 
  -        |> providedCommandType.AddMember
  -
  -        let executeArgs = this.GetExecuteArgsForSqlParameters(providedCommandType, sqlParameters, allParametersOptional) 
  +        let output = this.GetOutputTypes(outputColumns, resultType, singleRow)
  +        
  +        let cmdProvidedType = 
  +            let eraseTo = typedefof<_ SqlCommand>.MakeGenericType( [| output.ErasedToType |])
  +            ProvidedTypeDefinition(assembly, nameSpace, typeName, baseType = Some eraseTo, HideObjectMethods = true)
  +
  +        output.RowType |> Option.iter cmdProvidedType.AddMember
  +        
  +        cmdProvidedType.AddMember(
  +            ProvidedProperty("ConnectionStringOrName", typeof<string>, [], IsStatic = true, GetterCode = fun _ -> <@@ connectionStringOrName @@>))
  +
  +        let executeArgs = this.GetExecuteArgsForSqlParameters(cmdProvidedType, sqlParameters, allParametersOptional) 
           let paramExpr = Expr.NewArray( typeof<SqlParameter>, sqlParameters |> List.map QuotationsFactory.ToSqlParam)
   
           let ctor = ProvidedConstructor( [ ProvidedParameter("connectionString", typeof<string>, optionalValue = "") ])
  -        let methodInfo = SqlCommandFactory.GetMethod("ByConnectionString", runtimeType)
  -        let paramTail = [Expr.Value commandText; Expr.Value CommandType.Text; paramExpr; Expr.Value singleRow; mapper]
  +        let methodInfo = SqlCommandFactory.GetMethod("ByConnectionString", output.ErasedToType)
  +        let paramTail = [Expr.Value commandText; Expr.Value CommandType.Text; paramExpr; Expr.Value singleRow; output.MapperFromReader ]
           ctor.InvokeCode <- fun args -> 
               let getConnString = <@@ if not( String.IsNullOrEmpty(%%args.[0])) then %%args.[0] else connectionStringOrName @@>
               Expr.Call(methodInfo, getConnString::paramTail)
              
  -        providedCommandType.AddMember ctor
  +        cmdProvidedType.AddMember ctor
   
           let ctor = ProvidedConstructor( [ ProvidedParameter("transaction", typeof<SqlTransaction>) ])
  -        let methodInfo = SqlCommandFactory.GetMethod("ByTransaction", runtimeType)
  +        let methodInfo = SqlCommandFactory.GetMethod("ByTransaction", output.ErasedToType)
   
           ctor.InvokeCode <- fun args -> Expr.Call(methodInfo, args.[0]::paramTail)
   
  -        providedCommandType.AddMember ctor
  -
  -        let interfaceType = typedefof<_ ISqlCommand>.MakeGenericType([|runtimeType|])
  +        cmdProvidedType.AddMember ctor
  +
  +        let interfaceType = typedefof<_ ISqlCommand>.MakeGenericType([| output.ErasedToType |])
           let name = "Execute" + if outputColumns.IsEmpty && resultType <> ResultType.DataReader then "NonQuery" else ""
               
           this.AddExecute(sqlParameters, 
                           executeArgs, 
                           allParametersOptional, 
  -                        providedCommandType, 
  -                        providedOutputType, 
  -                        runtimeCommandType, 
  +                        cmdProvidedType, 
  +                        output.ProvidedType, 
  +                        cmdProvidedType.BaseType, 
                           interfaceType.GetMethod(name), 
                           "Execute")
           
  -        let asyncReturnType = ProvidedTypeBuilder.MakeGenericType(typedefof<_ Async>, [ providedOutputType ])
  +        let asyncReturnType = ProvidedTypeBuilder.MakeGenericType(typedefof<_ Async>, [ output.ProvidedType ])
           this.AddExecute(sqlParameters, 
                           executeArgs, 
                           allParametersOptional, 
  -                        providedCommandType, 
  +                        cmdProvidedType, 
                           asyncReturnType, 
  -                        runtimeCommandType, 
  +                        cmdProvidedType.BaseType, 
                           interfaceType.GetMethod("Async" + name), 
                           "AsyncExecute")
                   
  -        providedCommandType
  -
  -    member internal __.AddExecute(sqlParameters, executeArgs, allParametersOptional, providedCommandType, providedOutputType, erasedType, methodCall, name) =
  +        cmdProvidedType
  +
  +    member internal __.AddExecute(sqlParameters, executeArgs, allParametersOptional, cmdProvidedType, providedOutputType, erasedType, methodCall, name) =
           let mappedParamValues (exprArgs : Expr list) = 
               (exprArgs.Tail, sqlParameters)
               ||> List.map2 (fun expr info ->
  
positive.code:                 else
                      assert(p.Direction = ParameterDirection.Input)
                      let rowType = ProvidedTypeDefinition(p.TypeInfo.UdttName, Some typeof<obj[]>)
                      providedCommandType.AddMember rowType
                      let parameters = [ 
                          for p in p.TypeInfo.TvpColumns -> 
                              ProvidedParameter(p.Name, p.TypeInfo.ClrType, ?optionalValue = if p.IsNullable then Some null else None) 
  
negative.code:             
          let designTimeConnectionString = 
              if isByName
              then Configuration.ReadConnectionStringFromConfigFileByName(connectionStringName, config.ResolutionFolder, configFile)
              else connectionStringOrName
  
          use conn = new SqlConnection(designTimeConnectionString)
  