Out-QLRSqlDatabase

From PowerGUI Wiki

Jump to: navigation, search

Exports data to a database.

Contents

Syntax

Out-QLRSqlDatabase [-ServerName] <String> [-DatabaseName] <String> [-TableName] <String> [[-LoginMode] [<AuthMode>]] [[-Login] [<String>]] [[-Password] [<String>]] [-ConfigFile [<String>]] [-InputObject [<PSObject[]>]] [-Full] [<CommonParameters>]

Detailed Description

The Out-QLRSqlDatabase cmdlet exports input objects into a database. The valid input objects are: - DML/DDL command descriptors - Log record descriptors - Transaction descriptors



Related Commands

Parameters

Name Description Required? Pipeline Input Default Value
ServerName The SQL Server instance name where to load the output. true false
DatabaseName The database name where to load the output. true false
TableName The table name where to load the output.

If the table does not exist in the database, it will be created. If the table already exist, the output records will be added to the existing table. The columns will be mapped by column name according to the property name. Only those columns that exist in the table will be assigned by values, other properties and columns will be ignored. Tip: You can create a table with columns that you need, then execute this command with the Full parameter set. Only the properties you need will be exported.

true false
LoginMode The connection mode. Can be one of the following:

- Windows, the Windows authentication will be used - SQLServer, the SQL Server authentication will be used - Predefined, the connection mode will be set according to the setting in the configuration file

false false
Login The login name to connect to the SQL Server. If LoginMode is set to "Windows" or "Predefined", this parameter is ignored. false false
Password The password to connect to the SQL Server. If LoginMode is set to "Windows" or "Predefined", this parameter is ignored. false false
ConfigFile The configuration file name. The default configuration file is located at <%LocalAppData%>\Quest Software\Log Reader for SQL Server\QuestLogReader.config. You can use another configuration file.

If LoginMode is set to "Windows" or "SQLServer", this parameter is ignored.

false false
InputObject Objects that will be exported. Can be results of one of the following cmdlets:

- Get-QLRSqlCommand - Get-QLRSqlTransaction - Get-QLRSqlRecord

false true (ByValue)
Full Set this parameter to include additional properties to the output.

Note: Setting of this parameter may slow down the exporting process.

false false

Input Type

Quest.LogReader.SqlServer.Wrappers.CommandWrapper, Quest.LogReader.SqlServer.Wrappers.TransactionWrapper, Quest.LogReader.SqlServer.Wrappers.RecordWrapper

Return Values

None

Examples

EXAMPLE 1

$lr = New-QLRSqlReader –Online . Northwind Windows
Get-QLRSqlCommand $lr Out-QLRSqlDatabase . DBOut TableOut Windows
$lr.Close()

This commands open the online transaction log for the Northwind database on a local server. Then all DML/DDL commands are exported into TableOut table in DBOut database on a local server.

Personal tools