SQLProvider


MSSQL Provider

Parameters

DatabaseVendor

From the FSharp.Data.Sql.Common.DatabaseProviderTypes enumeration. For MSSQL, use Common.DatabaseProviderTypes.MSSQLSERVER.

1: 
let [<Literal>] dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER

ConnectionString

Basic connection string used to connect to MSSQL instance; typical connection strings for the driver apply here. See MSSQL Connecting Strings Documentation for a complete list of connection string options.

1: 
let [<Literal>] connString = "Server=localhost;Database=test;User Id=test;Password=test"

ConnectionStringName

Instead of storing the connection string in the source code / fsx script, you can store values in the App.config file. This is the name of the connectionString key/value pair stored in App.config.

1: 
2: 
// found in App.config
let [<Literal>] connexStringName = "DefaultConnectionString"

IndividualsAmount

Sets the count to load for each individual. See individuals for further info.

1: 
let [<Literal>] indivAmount = 1000

UseOptionTypes

If true, F# option types will be used in place of nullable database columns. If false, you will always receive the default value of the column's type, even if it is null in the database.

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
let [<Literal>] useOptTypes  = true

let sql =
    SqlDataProvider<
        dbVendor,
        connString,
        resPath,
        indivAmount,
        useOptTypes>

Because MSSQL databases can be huge, there is an optional constructor parameter TableNames that can be used as a filter.

Fork me on GitHub