en-US/about_SimplySql.help.txt
TOPIC
about_SimplySql SHORT DESCRIPTION SimplySql - Talking to relational databases the PowerShell way; Simple commands... Powerful opportunities. LONG DESCRIPTION SimplySql is a module that provides an intuitive set of cmdlets for talking to databases that abstracts the vendor specifics, allowing you to focus on getting work done. The basic pattern is to connect to a database, execute one or more sql statements and then close your database connection. This module provides cmdlets that map to this basic pattern. Open/Close/Show/Test/Set/Get -SqlConnection These cmdlets (Open/Close) enable you to connect to databases in straightforward terms without worrying about differences between database vendors. There is a specific "Open-*" cmdlet for each provider Show/Test cmdlets allow you to see what connections are currently active in your powershell session and see specific details about those connections. Set cmdlet allows you to change the default commandTimeout and the database/catalog in use (if the provider supports it). Get cmdlet retruns the underlying connection object itself. Invoke- SqlScalar/SqlQuery/SqlUpdate These cmdlets allow you to execute sql statements against the database connections that you have opened. Any type of statement can be used with any cmdlet, but the output is tailored to specific types of activity. Scalar is great for returning a single value, Query is used for returning one or more result sets (output is datarow for single resultset and table for multiple resultsets), Update is used for making modifications (insert, update, delete, etc) and its output is the number of rows effected. Get/Clear -SqlMessage These cmdlets provider access to informational messages, if the provider supports them. Get will return the messages generated by Invoke-SqlScalar/SqlQuery/SqlUpdate cmdlets. Messages are consumed as they are read and can be cleared, without reading, by calling the Clear cmdlet. The messages are timestamped to when they were received by calling command (and not necessarily when they were generated on the server since many implementations are Asynchronous.) Invoke-SqlBulkCopy This is intended to make moving data from one connection to another connection (even cross vendor) simple. This is highly optimized if the destination has a managed bulkcopy implemenation, otherwise it is only generally optimized. For example, SQL Server has a bulk copy class (SqlBulkCopy) that is easily implemented and provides an efficient means of inserting data into SQL Server. Start/Complete/Undo -SqlTransaction These cmdlets provide a simple way to wrap Invoke-Sql* (except for SqlBulkCopy) into a transaction and then either commit or rollback. Complete-SqlTransaction maps to COMMIT and Undo-SqlTransaction maps to ROLLBACK. EXAMPLES Examples of how to use the module or how the subject feature works in practice. KEYWORDS SimplySql SEE ALSO about_SimplySql |