OledbSql
1.0.2
Provides a simple means to execute SQL queries against any Oledb.net compliant database and return the results as Powershell objects.
FEATURES
* Uses OleDb.Net.
* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are returned as an
FEATURES
* Uses OleDb.Net.
* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are returned as an
Provides a simple means to execute SQL queries against any Oledb.net compliant database and return the results as Powershell objects.
FEATURES
* Uses OleDb.Net.
* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are returned as an integer value representing the quantity of rows affected.
* The returned objects' parameters are automaticly cast from their database types to their .Net equivalents.
* Connection strings can be saved with an alias for ease of use.
* Connection strings can contain parameters that query the user for input. Particularly useful for passwords.
* Duplicate column names are automatically given unique property names.
* Though OleDb.net is not as fast as a native provider, it is very flexable. For databases with an OleDB.net provider, the same code will work by prepending the correct 'Provider' clause to the connection string. See SQLConnections.txt for examples.
EXAMPLE
$ConnectionString = 'Provider=sqloledb; Data Source=%Server%; Initial Catalog=%Database%;Integrated Security=SSPI;'
$ConnectionObject = New-OledbConnection -ConnectionString $ConnectionString
Invoke-OledbSql -Connection $ConnectionObject -SQL 'select 1 as Ping'
This example creates a connection object, querying the user for the database and server names. It then issues a simple select that returns a '1' if the connection succeeds.
Show more
FEATURES
* Uses OleDb.Net.
* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are returned as an integer value representing the quantity of rows affected.
* The returned objects' parameters are automaticly cast from their database types to their .Net equivalents.
* Connection strings can be saved with an alias for ease of use.
* Connection strings can contain parameters that query the user for input. Particularly useful for passwords.
* Duplicate column names are automatically given unique property names.
* Though OleDb.net is not as fast as a native provider, it is very flexable. For databases with an OleDB.net provider, the same code will work by prepending the correct 'Provider' clause to the connection string. See SQLConnections.txt for examples.
EXAMPLE
$ConnectionString = 'Provider=sqloledb; Data Source=%Server%; Initial Catalog=%Database%;Integrated Security=SSPI;'
$ConnectionObject = New-OledbConnection -ConnectionString $ConnectionString
Invoke-OledbSql -Connection $ConnectionObject -SQL 'select 1 as Ping'
This example creates a connection object, querying the user for the database and server names. It then issues a simple select that returns a '1' if the connection succeeds.
The owner has unlisted this package.
This could mean that the module is deprecated or shouldn't be used anymore.
Installation Options
Owners
Copyright
(c) 2015 Nathan Hartley. All rights reserved.
Package Details
Author(s)
- Nathan Hartley
Tags
Functions
New-OledbConnection Invoke-OledbSql
Dependencies
This module has no dependencies.
FileList
- OledbSql.nuspec
- license.txt
- OledbSql.psd1
- OledbSql.psm1
- README.md
- SqlConnections.txt
- en-US\about_OledbSql.help.txt
- tests\OledbSql.Tests.ps1
- tests\test.csv
Version History
Version | Downloads | Last updated |
---|